# HG changeset patch # User Ben Abbott # Date 1355703260 18000 # Node ID d0579fed7e227396880ceffd39be4336f2d6608f # Parent ac9e34f835224e48d51cacda54c49452cf24241c struct2hdl.m: Set the "position" and "outerposition" properties in the order implied by "activepositionproperty". (Bug # 37913) diff -r ac9e34f83522 -r d0579fed7e22 scripts/plot/struct2hdl.m --- a/scripts/plot/struct2hdl.m Sat Dec 15 22:47:26 2012 -0800 +++ b/scripts/plot/struct2hdl.m Sun Dec 16 19:14:20 2012 -0500 @@ -92,12 +92,23 @@ p = p(1:2, 1:(tst(end)-1)); endif - ## Place the "*mode" properties as the end to avoid have the updaters - ## change the mode to "manual" when the value is "auto" + ## Place the "*mode" properties as the end to avoid having the updaters + ## change the mode to "manual" when the value is "auto". names = fieldnames (s.properties); n = strncmp (cellfun (@fliplr, names, "uniformoutput", false), "edom", 4); n = (n | strcmp (names, "activepositionproperty")); names = [names(!n); names(n)]; + if (strcmp (s.type, "axes")) + n_pos = find (strcmp (names, "position") | strcmp (names, "outerposition")); + if (strcmp (s.properties.activepositionproperty, "position")) + names{n_pos(1)} = "outerposition"; + names{n_pos(2)} = "position"; + else + names{n_pos(1)} = "position"; + names{n_pos(2)} = "outerposition"; + endif + endif + ## Reorder the properties with the mode properties coming last s.properties = orderfields (s.properties, names); ## create object