# HG changeset patch # User Konstantinos Poulios # Date 1297271143 -3600 # Node ID a3be83af8cfae166c5e4b9f8897c12ba70344274 # Parent 99477f7ad5f9c961b0603cd09af241b3cf418748 simplifications in position updating functions for axes labels and titles diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-02-09 Konstantinos Poulios + + * graphics.cc (axes::properties::update_xlabel_position, + axes::properties::update_ylabel_position, + axes::properties::update_zlabel_position, + axes::properties::update_title_position): Use get_transform only + when it is required. + (text::properties::request_autopos): Remove redundant temporary + settting of autopos_tag to none. + 2011-02-08 John W. Eaton * pr-output.cc (INSTANTIATE_ABS): Omit inline keyword from diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -4121,8 +4121,6 @@ void axes::properties::update_xlabel_position (void) { - graphics_xform xform = get_transform (); - text::properties& xlabel_props = reinterpret_cast (gh_manager::get_object (get_xlabel ()).get_properties ()); @@ -4150,6 +4148,8 @@ if (xlabel_props.positionmode_is ("auto") || xlabel_props.rotationmode_is ("auto")) { + graphics_xform xform = get_transform (); + Matrix ext (1, 2, 0.0); ext = get_ticklabel_extents (get_xtick ().matrix_value (), get_xticklabel ().all_strings (), @@ -4205,8 +4205,6 @@ void axes::properties::update_ylabel_position (void) { - graphics_xform xform = get_transform (); - text::properties& ylabel_props = reinterpret_cast (gh_manager::get_object (get_ylabel ()).get_properties ()); @@ -4234,6 +4232,8 @@ if (ylabel_props.positionmode_is ("auto") || ylabel_props.rotationmode_is ("auto")) { + graphics_xform xform = get_transform (); + Matrix ext (1, 2, 0.0); ext = get_ticklabel_extents (get_ytick ().matrix_value (), get_yticklabel ().all_strings (), @@ -4289,8 +4289,6 @@ void axes::properties::update_zlabel_position (void) { - graphics_xform xform = get_transform (); - text::properties& zlabel_props = reinterpret_cast (gh_manager::get_object (get_zlabel ()).get_properties ()); @@ -4320,6 +4318,8 @@ if (zlabel_props.positionmode_is ("auto") || zlabel_props.rotationmode_is ("auto")) { + graphics_xform xform = get_transform (); + Matrix ext (1, 2, 0.0); ext = get_ticklabel_extents (get_ztick ().matrix_value (), get_zticklabel ().all_strings (), @@ -4396,8 +4396,6 @@ void axes::properties::update_title_position (void) { - graphics_xform xform = get_transform (); - text::properties& title_props = reinterpret_cast (gh_manager::get_object (get_title ()).get_properties ()); @@ -4407,6 +4405,8 @@ if (title_props.positionmode_is ("auto")) { + graphics_xform xform = get_transform (); + // FIXME: bbox should be stored in axes::properties ColumnVector bbox(4); bbox(0) = octave_Inf; @@ -5731,12 +5731,7 @@ { if (autopos_tag_is ("xlabel") || autopos_tag_is ("ylabel") || autopos_tag_is ("zlabel") || autopos_tag_is ("title")) - { - const std::string text_type = get_autopos_tag (); - set_autopos_tag ("none"); - update_autopos (text_type); - set_autopos_tag (text_type); - } + update_autopos (get_autopos_tag ()); } void