]> git.tdb.fi Git - libs/gltk.git/commitdiff
Don't trigger widget rebuild if only its position changes
authorMikko Rasa <tdb@tdb.fi>
Wed, 26 Jun 2013 17:09:55 +0000 (20:09 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 26 Jun 2013 17:09:55 +0000 (20:09 +0300)
source/widget.cpp

index 7496f8bdda1e849c3f35768d2d2ca6f29a11f503..2183be6623b5467b0d1431f531a2cea6cb534897 100644 (file)
@@ -63,9 +63,14 @@ void Widget::autosize()
 
 void Widget::set_geometry(const Geometry &g)
 {
+       bool size_changed = (g.w!=geom.w || g.h!=geom.h);
        geom = g;
-       on_geometry_change();
-       rebuild();
+       if(size_changed)
+       {
+               // TODO maybe rename this to on_size_change
+               on_geometry_change();
+               rebuild();
+       }
 }
 
 void Widget::set_parent(Container *p)