Mercurial > octave
changeset 33593:ca958ca8c921 stable
Preserve "position" property of figure when object is reset() (bug #65750)
* graphics.cc (figure::reset_default_properties): Remove "innerposition", an
alias to "position", from the list of properties to reset. Remove
"paperpositionmode" from list of properties to reset.
* graphics.cc (Freset): Update BIST test for figure objects to verify
"position" and "paperposition" are not reset.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 17 May 2024 13:37:44 -0700 |
parents | 97b44c6e3e35 |
children | 2104a33b7e83 ca190a4a366c |
files | libinterp/corefcn/graphics.cc |
diffstat | 1 files changed, 16 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc Thu May 16 08:30:23 2024 -0700 +++ b/libinterp/corefcn/graphics.cc Fri May 17 13:37:44 2024 -0700 @@ -4728,9 +4728,11 @@ plist.erase ("units"); plist.erase ("position"); + plist.erase ("innerposition"); plist.erase ("outerposition"); plist.erase ("paperunits"); plist.erase ("paperposition"); + plist.erase ("paperpositionmode"); plist.erase ("windowstyle"); remove_all_listeners (); @@ -12110,15 +12112,23 @@ %! close (hf); %! end_unwind_protect -%!test # root object +%!test # figure object %! set (0, "defaultfigurevisible", "off"); -%! hf = figure ("visible", "off", "paperunits", "centimeters", -%! "papertype", "a4"); +%! hf = figure ("visible", "off", +%! "units", "normalized", +%! "position", [0, 0, pi/10, e/10], +%! "paperunits", "normalized", +%! "paperposition", [0.1, 0.1, 0.9, 0.9], +%! "tag", "foobar"); %! unwind_protect %! reset (hf); -%! assert (get (hf, "papertype"), get (0, "defaultfigurepapertype")); -%! assert (get (hf, "paperunits"), "centimeters"); # paperunits is unchanged -%! assert (get (hf, "visible"), get (0, "defaultfigurevisible")); +%! ## Ordinary property is reset +%! assert (get (hf, "tag"), ""); +%! ## Following 4 special properties are not reset +%! assert (get (hf, "units"), "normalized"); +%! assert (get (hf, "position"), [0, 0, pi/10, e/10]); +%! assert (get (hf, "paperunits"), "normalized"); +%! assert (get (hf, "paperposition"), [0.1, 0.1, 0.9, 0.9]); %! unwind_protect_cleanup %! close (hf); %! set (0, "defaultfigurevisible", "remove");