better DrawEllipticalArc behavior when dc.hasCurrent is true

This commit is contained in:
Michael Fogleman 2018-03-08 13:42:55 -05:00
parent da3d0863b9
commit c97f757e6f

View File

@ -548,9 +548,13 @@ func (dc *Context) DrawEllipticalArc(x, y, rx, ry, angle1, angle2 float64) {
y2 := y + ry*math.Sin(a2) y2 := y + ry*math.Sin(a2)
cx := 2*x1 - x0/2 - x2/2 cx := 2*x1 - x0/2 - x2/2
cy := 2*y1 - y0/2 - y2/2 cy := 2*y1 - y0/2 - y2/2
if i == 0 && !dc.hasCurrent { if i == 0 {
if dc.hasCurrent {
dc.LineTo(x0, y0)
} else {
dc.MoveTo(x0, y0) dc.MoveTo(x0, y0)
} }
}
dc.QuadraticTo(cx, cy, x2, y2) dc.QuadraticTo(cx, cy, x2, y2)
} }
} }