# HG changeset patch # User Ben Abbott # Date 1376343983 14400 # Node ID 8e196132bbea3d5b3a306b4635953539155250a7 # Parent a594e0d980eb10b1ca43ff99cd70ec3a90554f9e Tests for for updating axes properties when figure position changes. * libinterp/corefcn/graphics.cc: Add tests (bug # 39650). After enlarging figure and returning it to its original position, verify the position, outerposition, looseinset, and tightinset are the same. diff -r a594e0d980eb -r 8e196132bbea libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Mon Aug 12 15:32:08 2013 -0500 +++ b/libinterp/corefcn/graphics.cc Mon Aug 12 17:46:23 2013 -0400 @@ -4094,6 +4094,45 @@ %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect +%!test +%! hf = figure ("visible", "off"); +%! graphics_toolkit (hf, "fltk"); +%! fpos = get (hf, "position"); +%! unwind_protect +%! plot (rand (3)) +%! position = get (gca, "position"); +%! outerposition = get (gca, "outerposition"); +%! looseinset = get (gca, "looseinset"); +%! tightinset = get (gca, "tightinset"); +%! set (hf, "position", [fpos(1:2), 2*fpos(3:4)]) +%! set (hf, "position", fpos); +%! assert (get (gca, "outerposition"), outerposition, 0.001) +%! assert (get (gca, "position"), position, 0.001) +%! assert (get (gca, "looseinset"), looseinset, 0.001) +%! assert (get (gca, "tightinset"), tightinset, 0.001) +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect +%!test +%! hf = figure ("visible", "off"); +%! graphics_toolkit (hf, "fltk"); +%! fpos = get (hf, "position"); +%! set (gca, "activepositionproperty", "position") +%! unwind_protect +%! plot (rand (3)) +%! position = get (gca, "position"); +%! outerposition = get (gca, "outerposition"); +%! looseinset = get (gca, "looseinset"); +%! tightinset = get (gca, "tightinset"); +%! set (hf, "position", [fpos(1:2), 2*fpos(3:4)]) +%! set (hf, "position", fpos); +%! assert (get (gca, "position"), position, 0.001) +%! assert (get (gca, "outerposition"), outerposition, 0.001) +%! assert (get (gca, "looseinset"), looseinset, 0.001) +%! assert (get (gca, "tightinset"), tightinset, 0.001) +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect */ void