The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Copy SVG paths

These changes was commited to the Birdfont repository Wed, 08 Jun 2016 19:21:15 +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:21:15 +0000 (21:21 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 08 Jun 2016 19:21:15 +0000 (21:21 +0200)
commit d86e42dba5b12fd7a9730a40b77e46afb64da5dd
tree dbe2a988c32e6ed564b97534ca895f8e3d5095c5
parent 6c1f4544261615736fa6fc1b1f0b51763699c58e
Copy SVG paths

libsvgbird/Doubles.vala
libsvgbird/Points.vala
libsvgbird/SvgPath.vala
--- a/libsvgbird/Doubles.vala +++ b/libsvgbird/Doubles.vala @@ -65,7 +65,7 @@ public Doubles copy () { Doubles d = new Doubles (); delete d.data; - d.data = new double[capacity]; + d.data = new PointValue[capacity]; d.capacity = capacity; d.size = size; Posix.memcpy (d.data, data, sizeof (PointValue) * size);
--- a/libsvgbird/Points.vala +++ b/libsvgbird/Points.vala @@ -33,9 +33,18 @@ public void add_type (uchar type) { point_data.add_type (type); + } + + public Points copy () { + Points p = new Points (); + p.point_data = point_data.copy (); + p.x = x; + p.y = y; + p.closed = closed; + return p; } } }
--- a/libsvgbird/SvgPath.vala +++ b/libsvgbird/SvgPath.vala @@ -24,6 +24,10 @@ public SvgPath.create_copy (SvgPath p) { Object.copy_attributes (p, this); + + foreach (Points point_data in p.points) { + points.add (point_data.copy ()); + } } public override bool is_over (double x, double y) {