The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix position of SVG ellipse

These changes was commited to the Birdfont repository Wed, 08 Jun 2016 19:05:01 +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 19:05:01 +0000 (21:05 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 08 Jun 2016 19:05:01 +0000 (21:05 +0200)
commit 6c1f4544261615736fa6fc1b1f0b51763699c58e
tree 6a12b0f925826a691ef74c1558c652f1f0011f03
parent d85d7a8cc7762ee782010a52ebfce6426a917f73
Fix position of SVG ellipse

libbirdfont/Glyph.vala
libsvgbird/Circle.vala
libsvgbird/Ellipse.vala
libsvgbird/Rectangle.vala
libsvgbird/SvgDrawing.vala
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -1827,7 +1827,7 @@ redo_list.clear (); } - // set_glyph_data (g); // FIXME: DELETE + set_glyph_data (g); // FIXME: DELETE } public void print_layers (Layer layer, int indent = 0) {
--- a/libsvgbird/Circle.vala +++ b/libsvgbird/Circle.vala @@ -23,13 +23,6 @@ public double r = 0; public Circle () { - } - - public Circle.create_copy (Circle c) { - Object.copy_attributes (c, this); - cx = c.cx; - cx = c.cy; - r = c.r; } public override bool is_over (double x, double y) { @@ -57,7 +50,14 @@ } public override Object copy () { - return new Circle.create_copy (this); + Circle c = new Circle (); + + Object.copy_attributes (this, c); + c.cx = cx; + c.cx = cy; + c.r = r; + + return c; } public override string to_string () {
--- a/libsvgbird/Ellipse.vala +++ b/libsvgbird/Ellipse.vala @@ -25,14 +25,6 @@ public double ry = 0; public Ellipse () { - } - - public Ellipse.create_copy (Ellipse c) { - Object.copy_attributes (c, this); - cx = c.cx; - cx = c.cy; - rx = c.rx; - ry = c.ry; } public override bool is_over (double x, double y) { @@ -64,7 +56,16 @@ } public override Object copy () { - return new Ellipse.create_copy (this); + Ellipse e = new Ellipse (); + Object.copy_attributes (this, e); + + print (@"cy $(cy)\n"); + + e.cx = cx; + e.cy = cy; + e.rx = rx; + e.ry = ry; + return e; } public override string to_string () {
--- a/libsvgbird/Rectangle.vala +++ b/libsvgbird/Rectangle.vala @@ -23,6 +23,8 @@ public double y = 0; public double width = 0; public double height = 0; + + /** Corner radius */ public double rx = 0; public double ry = 0; @@ -81,6 +83,8 @@ r.x = x; r.y = y; + r.rx = rx; + r.ry = ry; r.width = width; r.height = height;
--- a/libsvgbird/SvgDrawing.vala +++ b/libsvgbird/SvgDrawing.vala @@ -33,12 +33,21 @@ set { svg_width = value; + } + } + + public double height { + get { + return svg_height; + } + + set { + svg_height = value; } } public double svg_width = 0; - - public double height = 0; + public double svg_height = 0; public override double xmin { get { @@ -94,6 +103,7 @@ public override Object copy () { SvgDrawing drawing = new SvgDrawing (); + SvgBird.Object.copy_attributes (this, drawing); drawing.root_layer = (Layer) root_layer.copy (); drawing.defs = defs.copy (); drawing.x = x;