The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Insert points in SVG paths

These changes was commited to the Birdfont repository Sun, 02 Oct 2016 13:04:06 +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>
Sun, 02 Oct 2016 13:04:06 +0000 (15:04 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 02 Oct 2016 13:04:06 +0000 (15:04 +0200)
commit 9ddcb091d91719d0b70dd0b6910a40a33d8a0807
tree 448bf3933322e229baed86c0aab4f7fc7e103f39
parent 7ea18e0601ade8ae5cf2966fc2746eeaa82d0440
Insert points in SVG paths

libsvgbird/Points.vala
--- a/libsvgbird/Points.vala +++ b/libsvgbird/Points.vala @@ -53,10 +53,18 @@ } public int add_cubic (double handle_x, double handle_y, + double next_handle_x, double next_handle_y, + double x, double y) { + + return insert_cubic (size, handle_x, handle_y, + next_handle_x, next_handle_y, x, y); + } + + public int insert_cubic (int position, double handle_x, double handle_y, double next_handle_x, double next_handle_y, double x, double y) { - int index; + int index = position; if (size == 0) { index = 0; @@ -70,7 +78,7 @@ insert (index + 7, 0); } - index = size; + index = position; insert_type (index, POINT_CUBIC); insert (index + 1, handle_x); insert (index + 2, handle_y); @@ -82,7 +90,7 @@ return index; } - + public Points copy () { Points p = new Points (); p.point_data = point_data.copy ();