Commit f2f2927
Copy SVG attributes for several objects
Changed files (5)
modifiedlibsvgbird/Circle.valamodifiedlibsvgbird/Ellipse.valamodifiedlibsvgbird/Layer.valamodifiedlibsvgbird/Line.valamodifiedlibsvgbird/ObjectGroup.vala
Diff
@@ -27,9 +27,9 @@ public class Circle : Object { public Circle.create_copy (Circle c) { Object.copy_attributes (c, this);- c.cx = cx;- c.cx = cy;- c.r = r;+ cx = c.cx;+ cx = c.cy;+ r = c.r; } public override bool is_over (double x, double y) {@@ -29,10 +29,10 @@ public class Ellipse : Object { public Ellipse.create_copy (Ellipse c) { Object.copy_attributes (c, this);- c.cx = cx;- c.cx = cy;- c.rx = rx;- c.ry = ry;+ cx = c.cx;+ cx = c.cy;+ rx = c.rx;+ ry = c.ry; } public override bool is_over (double x, double y) {@@ -111,7 +111,10 @@ public class Layer : Object { Layer layer = new Layer (); copy_layer (this, layer); Object.copy_attributes (this, layer);- stdout.printf (@"Copy $name\n");+ + stdout.printf (@"Copy $(layer.name)\n");+ layer.objects.print_objects ();+ return layer; } @@ -28,10 +28,10 @@ public class Line : Object { public Line.create_copy (Line c) { Object.copy_attributes (c, this);- c.x1 = x1;- c.y1 = y1;- c.x2 = x2;- c.y2 = y2;+ x1 = c.x1;+ y1 = c.y1;+ x2 = c.x2;+ y2 = c.y2; } public override bool is_over (double x, double y) {@@ -71,6 +71,13 @@ public class ObjectGroup : GLib.Object { return objects_copy; }+ + public void print_objects () {+ foreach (Object o in objects) {+ stdout.printf (o.to_string ());+ stdout.printf ("\n");+ }+ } } }