Clone in a terminal:
Commit 17daa94
Johan Mattsson - 2019-09-28T17:31:54+00:00
17daa9446d42a08ff72e77ce082502d4f78a9094johan.mattsson.m@gmail.com

Fix ellipse

Changed files (1)

Diff

diff --git a/libbirdfont/CircleTool.vala b/libbirdfont/CircleTool.valaindex 656b4f6..0d6a337 100644--- a/libbirdfont/CircleTool.vala+++ b/libbirdfont/CircleTool.vala@@ -140,31 +140,23 @@ public class CircleTool : Tool {  		return path; 	}-	+ 	public static Path create_ellipse (double x, double y,-		double rx, double ry, PointType pt) {	-		-		double px, py;-		Path path = new Path ();-		double steps = (pt == PointType.QUADRATIC) ? PI / 8 : PI / 4;  +		double rx, double ry, PointType point_type) {	 		-		for (double angle = 0; angle < 2 * PI; angle += steps) {-			px = rx * cos (angle) + x;-			py = ry * sin (angle) + y;-			path.add (px, py);-		}+		Path path = create_circle (x, y, 1, point_type);+	+		SvgTransforms transforms = new SvgTransforms ();+		transforms.resize (rx, ry, x, y); 		-		path.init_point_type (pt);-		path.close ();-		path.recalculate_linear_handles ();+		transforms.collapse_transforms ();+		Matrix m = transforms.get_matrix ();+		path.transform (m); -		for (int i = 0; i < 3; i++) {-			foreach (EditPoint ep in path.points) {-				ep.set_tie_handle (true);-				ep.process_tied_handle ();-			}+		foreach (EditPoint ep in path.points) {+			ep.set_tie_handle (true); 		}-+		 		return path; 	} 	

Contact

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