The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Copy SVG attributes for several objects

These changes was commited to the Birdfont repository Wed, 08 Jun 2016 11:12:24 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 08 Jun 2016 11:12:24 +0000 (13:12 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 08 Jun 2016 11:12:24 +0000 (13:12 +0200)
commit f2f2927f7d7c42304b4fd98d985edfa0e9f3c7bc
tree 5121b0935f153c83d92f7a8753aa8748b79fab41
parent 6bf7a3494c195dca615e1c134561669a37de61e3
Copy SVG attributes for several objects

libsvgbird/Circle.vala
libsvgbird/Ellipse.vala
libsvgbird/Layer.vala
libsvgbird/Line.vala
libsvgbird/ObjectGroup.vala
--- a/libsvgbird/Circle.vala +++ b/libsvgbird/Circle.vala @@ -27,9 +27,9 @@ 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) {
--- a/libsvgbird/Ellipse.vala +++ b/libsvgbird/Ellipse.vala @@ -29,10 +29,10 @@ 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) {
--- a/libsvgbird/Layer.vala +++ b/libsvgbird/Layer.vala @@ -111,7 +111,10 @@ 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; }
--- a/libsvgbird/Line.vala +++ b/libsvgbird/Line.vala @@ -28,10 +28,10 @@ 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) {
--- a/libsvgbird/ObjectGroup.vala +++ b/libsvgbird/ObjectGroup.vala @@ -70,8 +70,15 @@ } return objects_copy; + } + + public void print_objects () { + foreach (Object o in objects) { + stdout.printf (o.to_string ()); + stdout.printf ("\n"); + } } } }