Index: src/graphics.h.in =================================================================== RCS file: /cvs/octave/src/graphics.h.in,v retrieving revision 1.56 diff -c -p -r1.56 graphics.h.in *** src/graphics.h.in 4 Feb 2008 21:17:19 -0000 1.56 --- src/graphics.h.in 5 Feb 2008 15:53:30 -0000 *************** public: *** 1341,1346 **** --- 1341,1349 ---- virtual graphics_backend get_backend (void) const; + virtual Matrix get_boundingbox (bool internal = false) const + { return Matrix (1, 4, 0.0); } + void set_tag (const octave_value& val) { tag = val; } void set_parent (const octave_value& val); *************** public: *** 2076,2082 **** } } ! Matrix get_boundingbox (void) const; // See the genprops.awk script for an explanation of the // properties declarations. --- 2079,2085 ---- } } ! Matrix get_boundingbox (bool internal = false) const; // See the genprops.awk script for an explanation of the // properties declarations. *************** public: *** 2288,2294 **** const scaler& get_y_scaler (void) const { return sy; } const scaler& get_z_scaler (void) const { return sz; } ! Matrix get_boundingbox (void) const; void update_camera (void); void update_aspectratios (void); --- 2291,2297 ---- const scaler& get_y_scaler (void) const { return sy; } const scaler& get_z_scaler (void) const { return sz; } ! Matrix get_boundingbox (bool internal = false) const; void update_camera (void); void update_aspectratios (void); Index: src/graphics.cc =================================================================== RCS file: /cvs/octave/src/graphics.cc,v retrieving revision 1.84 diff -c -p -r1.84 graphics.cc *** src/graphics.cc 4 Feb 2008 21:17:18 -0000 1.84 --- src/graphics.cc 5 Feb 2008 15:53:30 -0000 *************** figure::properties::close (bool pop) *** 1419,1425 **** } Matrix ! figure::properties::get_boundingbox (void) const { graphics_backend b = get_backend (); // FIXME: screen size should be obtained from root object --- 1421,1427 ---- } Matrix ! figure::properties::get_boundingbox (bool) const { graphics_backend b = get_backend (); // FIXME: screen size should be obtained from root object *************** figure::properties::get_boundingbox (voi *** 1431,1436 **** --- 1433,1439 ---- pos(0)--; pos(1)--; + pos(1) = screen_size(1) - pos(1) - pos(3); return pos; } *************** axes::properties::update_camera (void) *** 1956,1964 **** double xM = cmax(0)-cmin(0); double yM = cmax(1)-cmin(1); ! Matrix bb = get_boundingbox (); ! Matrix cs = get_backend ().get_canvas_size (__myhandle__); ! double fh = cs(1); double v_angle; --- 1959,1965 ---- double xM = cmax(0)-cmin(0); double yM = cmax(1)-cmin(1); ! Matrix bb = get_boundingbox (true); double v_angle; *************** axes::properties::update_camera (void) *** 1992,1998 **** { xM *= pf; yM *= pf; ! translate (x_viewport, bb(0)+bb(2)/2, fh-(bb(1)+bb(3)/2)+1, 0); scale (x_viewport, bb(2)/xM, -bb(3)/yM, 1); } else --- 1993,1999 ---- { xM *= pf; yM *= pf; ! translate (x_viewport, bb(0)+bb(2)/2, bb(1)+bb(3)/2, 0); scale (x_viewport, bb(2)/xM, -bb(3)/yM, 1); } else *************** axes::properties::update_camera (void) *** 2007,2013 **** } else pix = (bb(2) < bb(3) ? bb(2) : bb(3)); ! translate (x_viewport, bb(0)+bb(2)/2, fh-(bb(1)+bb(3)/2)+1, 0); scale (x_viewport, pix, -pix, 1); } --- 2008,2014 ---- } else pix = (bb(2) < bb(3) ? bb(2) : bb(3)); ! translate (x_viewport, bb(0)+bb(2)/2, bb(1)+bb(3)/2, 0); scale (x_viewport, pix, -pix, 1); } *************** axes::properties::update_aspectratios (v *** 2086,2100 **** } Matrix ! axes::properties::get_boundingbox (void) const { ! graphics_backend b = get_backend (); ! Matrix pos; ! ! pos = convert_position (get_position ().matrix_value (), get_units (), ! "pixels", b.get_canvas_size (__myhandle__), b); pos(0)--; pos(1)--; return pos; } --- 2087,2106 ---- } Matrix ! axes::properties::get_boundingbox (bool internal) const { ! graphics_object obj = gh_manager::get_object (get_parent ()); ! Matrix parent_bb = obj.get_properties ().get_boundingbox (true); ! Matrix pos = (internal ? ! get_position ().matrix_value () ! : get_outerposition ().matrix_value ()); ! ! ! pos = convert_position (pos, get_units (), "pixels", ! parent_bb.extract_n (0, 2, 1, 2), get_backend ()); pos(0)--; pos(1)--; + pos(1) = parent_bb(3) - pos(1) - pos(3); return pos; }