From 8d6b9ced7f03109f477838b50cbdfdddeb9c919e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 28 Jul 2016 13:49:08 +0300 Subject: [PATCH] Don't do a potentially expensive mesh update if nothing changed --- source/text.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.45.2