From: Mikko Rasa Date: Thu, 28 Jul 2016 10:49:08 +0000 (+0300) Subject: Don't do a potentially expensive mesh update if nothing changed X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=8d6b9ced7f03109f477838b50cbdfdddeb9c919e;p=libs%2Fgl.git Don't do a potentially expensive mesh update if nothing changed --- diff --git a/source/text.cpp b/source/text.cpp index 03421f54..85647a83 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -71,6 +71,9 @@ void Text::set_alignment(HorizontalAlign ha, VerticalAlign va) void Text::set_alignment(float h, float v) { + if(h==horz_align && -v==vert_offset) + return; + float horz_adjust = (horz_align-h)*width; float vert_adjust = -v-vert_offset; horz_align = h;