changeset 14367:ba01a38bc5c1

Use internal bounding box in figure::properties::set_position. * graphics.cc (figure::properties::update_units): Don't run listeners when changing units property. * graphics.cc (figure::properties::set_position): Use internal bounding box to trigger update actions. Move listeners execution to the end.
author Ben Abbott <bpabbott@mac.com>
date Wed, 15 Feb 2012 18:41:12 -0500
parents b76f0740940e
children 5736d93b22d0
files src/graphics.cc
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/graphics.cc	Wed Feb 15 13:31:31 2012 -0800
+++ b/src/graphics.cc	Wed Feb 15 18:41:12 2012 -0500
@@ -3254,10 +3254,11 @@
   if (! error_state)
     {
       Matrix old_bb, new_bb;
-
-      old_bb = get_boundingbox ();
-      position.set (v, true, do_notify_toolkit);
-      new_bb = get_boundingbox ();
+      bool modified = false;
+
+      old_bb = get_boundingbox (true);
+      modified = position.set (v, false, do_notify_toolkit);
+      new_bb = get_boundingbox (true);
 
       if (old_bb != new_bb)
         {
@@ -3268,7 +3269,11 @@
             }
         }
 
-      mark_modified ();
+      if (modified)
+        {
+          position.run_listeners (POSTSET);
+          mark_modified ();
+        }
     }
 }
 
@@ -3711,8 +3716,8 @@
 void
 figure::properties::update_units (const caseless_str& old_units)
 {
-  set_position (convert_position (get_position ().matrix_value (), old_units,
-                                  get_units (), screen_size_pixels ()));
+  position.set (convert_position (get_position ().matrix_value (), old_units,
+                                  get_units (), screen_size_pixels ()), false);
 }
 
 /*