]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't do a potentially expensive mesh update if nothing changed
authorMikko Rasa <tdb@tdb.fi>
Thu, 28 Jul 2016 10:49:08 +0000 (13:49 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 28 Jul 2016 10:49:08 +0000 (13:49 +0300)
source/text.cpp

index 03421f5457c5ed3385548034115a6e18e1933269..85647a83980b9fbc0bdf45514460859a8c98a6f2 100644 (file)
@@ -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;