Clone in a terminal:
Commit 9919653
Johan Mattsson - 2016-07-26T15:29:51+00:00
991965389ac6dbebfe193d3f46a75dc1b3f1114djohan.mattsson.m@gmail.com

Remove points

Changed files (3)

Diff

diff --git a/libsvgbird/Doubles.vala b/libsvgbird/Doubles.valaindex ceb8c3f..9e44a8b 100644--- a/libsvgbird/Doubles.vala+++ b/libsvgbird/Doubles.vala@@ -34,6 +34,10 @@ public class Doubles : GLib.Object { 		delete data; 		data = null; 	}++	public void clear () {+		size = 0;+	} 	 	public void set_double (int index, double p) { 		if (unlikely (index < 0)) {@@ -111,6 +115,18 @@ public class Doubles : GLib.Object { 		} 	} 	+	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;diff --git a/libsvgbird/Object.vala b/libsvgbird/Object.valaindex bcaee14..210eafa 100644--- a/libsvgbird/Object.vala+++ b/libsvgbird/Object.vala@@ -31,6 +31,11 @@ public abstract class Object : GLib.Object { 	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 { 			return bottom - top;@@ -272,8 +277,12 @@ public abstract class Object : GLib.Object { 				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 @@ public abstract class Object : GLib.Object { 			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;diff --git a/libsvgbird/SvgFile.vala b/libsvgbird/SvgFile.valaindex 1f5f55a..8b378e2 100644--- a/libsvgbird/SvgFile.vala+++ b/libsvgbird/SvgFile.vala@@ -762,8 +762,6 @@ public class SvgFile : GLib.Object { 		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])); 		}

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112