Mercurial > hg > octave-nkf
diff src/graphics.cc @ 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 | e7c74f56cd03 |
children | c9ec21bef97a |
line wrap: on
line diff
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -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); } /*