respect defaults

This commit is contained in:
Simon Christ 2021-11-10 21:18:08 +01:00
parent bcdb212f2d
commit c4d3502608

View File

@ -1949,9 +1949,12 @@ end
function _update_subplot_legend(sp::Subplot, plotattributes_in)
f_attr = NamedTuple( k => plotattributes_in[Symbol(:legend_font_, k)] for k in (:family, :pointsize, :valign, :halign, :rotation, :color) if haskey(plotattributes_in, Symbol(:legend_font_, k)))
match_attr = NamedTuple( k => sp[Symbol(:legend_font_, k)] for k in (:family, :pointsize, :valign, :halign, :rotation, :color) if haskey(_match_map, Symbol(:legend_font_, k)))
sp.attr[:legend_font] = font(default(plotattributes_in, :legend_font);
merge(f_attr, match_attr)...
match_attr = NamedTuple( (lk = Symbol(:legend_font_, k); k => haskey(_match_map, lk) ? sp[lk] :
haskey(plotattributes_in, :legend_font) ? getproperty(plotattributes_in[:legend_font], k) :
default(plotattributes_in, lk))
for k in (:family, :pointsize, :valign, :halign, :rotation, :color))
sp.attr[:legend_font] = font(;
merge(match_attr, f_attr)...
)
end