changeset 27465:fdcec1c0842a

legend.m: Implement "edgecolor" property if supplied in initial creation call (bug #56968). * legend.m: After using "addproperty" to add legend property "edgecolor" to axes graphic object, check to see if "edgecolor" was specified. If it was, color the axes graphic object with specified color.
author Rik <rik@octave.org>
date Mon, 30 Sep 2019 11:29:02 -0700
parents b9c3717d68c5
children 6e8dac65d405
files scripts/plot/appearance/legend.m
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m	Mon Sep 30 11:25:23 2019 -0700
+++ b/scripts/plot/appearance/legend.m	Mon Sep 30 11:29:02 2019 -0700
@@ -669,6 +669,13 @@
           set (hlegend, propvals{:});
         endif
 
+        ## Special case of PROPERTY "edgecolor" (bug #56968)
+        ec_idx = find (strcmpi (propvals, "edgecolor"), 1, "last");
+        if (! isempty (ec_idx))
+          ec_color = propvals{ec_idx + 1};
+          set (hlegend, "xcolor", ec_color, "ycolor", ec_color);
+        endif
+
         ## Text objects in key inherit visual properties from legend object
         legprops = { "fontunits", "fontangle", "fontname", "fontsize", ...
                      "fontweight", "interpreter", "textcolor" };