The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Remove points

These changes was commited to the Birdfont repository Tue, 26 Jul 2016 15:29:51 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Tue, 26 Jul 2016 15:29:51 +0000]

Updated Files

libsvgbird/Doubles.vala
libsvgbird/Object.vala
libsvgbird/SvgFile.vala
--- a/libsvgbird/Doubles.vala +++ b/libsvgbird/Doubles.vala @@ -33,6 +33,10 @@ ~Doubles () { delete data; data = null; + } + + public void clear () { + size = 0; } public void set_double (int index, double p) { @@ -111,6 +115,18 @@ } } + public void remove (int offset, int length) { + if (unlikely (offset < 0 || offset + length > size)) { + warning ("Invalid offset."); + return; + } + + for (int i = offset; i < size; i++) { + data[i] = data[i + length]; + } + + size -= length; + } void increase_capacity () { int new_capacity = 2 * capacity;
--- a/libsvgbird/Object.vala +++ b/libsvgbird/Object.vala @@ -30,6 +30,11 @@ public virtual double right { get; set; } public virtual double top { get; set; } public virtual double bottom { get; set; } + + public virtual double boundaries_x0 { get; set; } + public virtual double boundaries_y0 { get; set; } + public virtual double boundaries_x1 { get; set; } + public virtual double boundaries_y1 { get; set; } public virtual double boundaries_height { get { @@ -272,8 +277,12 @@ Color c = s.color; pattern.add_color_stop_rgba (s.offset, c.r, c.g, c.b, c.a); } - - cr.set_source (pattern); + + if (likely (pattern.status () == 0)) { + cr.set_source (pattern); + } else { + warning ("Invalid pattern."); + } } } @@ -319,6 +328,11 @@ context.fill_extents (out x0, out y0, out x1, out y1); } + boundaries_x0 = x0; + boundaries_y0 = y0; + boundaries_x1 = x1; + boundaries_y1 = y1; + double point_x0 = x0; double point_y0 = y0; double point_x1 = x1;
--- a/libsvgbird/SvgFile.vala +++ b/libsvgbird/SvgFile.vala @@ -761,8 +761,6 @@ string[] p = parameters.split (" "); SvgTransform transform = new SvgTransform (); transform.type = TransformType.SCALE; - - print (@"scale $parameters len $(p.length)\n"); if (p.length > 0) { transform.arguments.add (parse_double (p[0]));