From f23d82b1067e1da3a443246e976269ce4765227c Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 20 Feb 2019 17:08:29 +1030 Subject: [PATCH] Use fewer ops to calculate mid-point --- context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/context.go b/context.go index 49d1714..9619d61 100644 --- a/context.go +++ b/context.go @@ -585,8 +585,8 @@ func (dc *Context) DrawEllipticalArc(x, y, rx, ry, angle1, angle2 float64) { a2 := angle1 + (angle2-angle1)*p2 x0 := x + rx*math.Cos(a1) y0 := y + ry*math.Sin(a1) - x1 := x + rx*math.Cos(a1+(a2-a1)/2) - y1 := y + ry*math.Sin(a1+(a2-a1)/2) + x1 := x + rx*math.Cos((a1+a2)/2) + y1 := y + ry*math.Sin((a1+a2)/2) x2 := x + rx*math.Cos(a2) y2 := y + ry*math.Sin(a2) cx := 2*x1 - x0/2 - x2/2