# HG changeset patch # User Pantxo Diribarne # Date 1574178011 -3600 # Node ID 39ac47fdcda21c1e33984b4a70e7f7d62143ec0c # Parent 842d4221ac6cdf38161dfe023557b097eba7ad30 legend.m: handle "edgecolor" passed at legend creation (bug #56968) * legend.m (update_edgecolor_cb): New subfunction to handle edgecolor property. Call it in property listener but also at legend creation. diff -r 842d4221ac6c -r 39ac47fdcda2 scripts/plot/appearance/legend.m --- a/scripts/plot/appearance/legend.m Tue Nov 19 16:21:16 2019 +0100 +++ b/scripts/plot/appearance/legend.m Tue Nov 19 16:40:11 2019 +0100 @@ -1,4 +1,4 @@ -## Copyright (C) 2010-2019 David Bateman +# Copyright (C) 2010-2019 David Bateman ## ## This file is part of Octave. ## @@ -214,8 +214,9 @@ "__next_label_index__", opts.next_idx, "__peer_objects__", opts.obj_handles); update_location_cb (hl, [], false); + update_edgecolor_cb (hl); + update_numchild_cb (hl); update_layout_cb (hl, [], true); - update_numchild_cb (hl); ## Dummy invisible object that deletes the legend when "newplot" is called ht = __go_text__ (opts.axes_handles(1), "tag", "__legend_watcher__", @@ -257,9 +258,7 @@ addlistener (hl, "box", @update_box_cb); - addlistener (hl, "edgecolor", ... - @(h) set (hl, "xcolor", get (hl, "edgecolor"), ... - "ycolor", get (hl, "edgecolor"))); + addlistener (hl, "edgecolor", @update_edgecolor_cb); addlistener (hl, "location", @update_location_cb); @@ -321,6 +320,13 @@ endfunction +function update_edgecolor_cb (hl) + + set (hl, "xcolor", get (hl, "edgecolor"), ... + "ycolor", get (hl, "edgecolor")) + +endfunction + function update_position_cb (hl) updating = getappdata (hl, "__updating_layout__");