Commit d85d7a8
Copy style attributes
Changed files (4)
modifiedlibbirdfont/EmbeddedSvg.valamodifiedlibbirdfont/Glyph.valamodifiedlibsvgbird/Layer.valamodifiedlibsvgbird/SvgStyle.vala
Diff
@@ -105,11 +105,10 @@ public class EmbeddedSvg : SvgBird.Object { public override SvgBird.Object copy () { EmbeddedSvg svg = new EmbeddedSvg ((SvgDrawing) drawing.copy ());- + SvgBird.Object.copy_attributes (this, svg); svg.svg_data = svg_data; svg.x = x; svg.y = y;- return svg; } @@ -1826,6 +1826,8 @@ public class Glyph : FontDisplay { if (clear_redo) { redo_list.clear (); }+ + // set_glyph_data (g); // FIXME: DELETE } public void print_layers (Layer layer, int indent = 0) {@@ -111,10 +111,6 @@ public class Layer : Object { Layer layer = new Layer (); copy_layer (this, layer); Object.copy_attributes (this, layer);- - stdout.printf (@"Copy $(layer.name)\n");- layer.objects.print_objects ();- return layer; } @@ -99,9 +99,31 @@ public class SvgStyle : GLib.Object { } public SvgStyle copy () {- SvgStyle style = new SvgStyle ();- style.apply (this);- return style;+ SvgStyle style_copy = new SvgStyle ();++ foreach (string key in style.keys) {+ style_copy.style.set (key, style.get (key));+ }++ if (stroke != null) {+ style_copy.stroke = ((!) stroke).copy ();+ }++ if (fill != null) {+ style_copy.fill = ((!) fill).copy ();+ }++ if (stroke_gradient != null) {+ style_copy.stroke_gradient = ((!) stroke_gradient).copy ();+ }++ if (fill_gradient != null) {+ style_copy.fill_gradient = ((!) fill_gradient).copy ();+ }+ + style_copy.stroke_width = stroke_width;+ + return style_copy; } public LineCap get_line_cap () {