From 63128da6ce07c18f84cf0fb68c2a3d953f10fc0c Mon Sep 17 00:00:00 2001 From: faiface <faiface@ksp.sk> Date: Fri, 10 Mar 2017 14:54:20 +0100 Subject: [PATCH] add IM.FillCircle and IM.FillEllipse --- graphics.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/graphics.go b/graphics.go index 15e7977..b9984e6 100644 --- a/graphics.go +++ b/graphics.go @@ -188,8 +188,6 @@ func (im *IM) SetColorMask(color color.Color) { // FillConvexPolygon takes all points Pushed into the IM's queue and fills the convex polygon formed // by them. -// -// It empties the queue after. func (im *IM) FillConvexPolygon() { points := im.points im.points = nil @@ -223,10 +221,18 @@ func (im *IM) FillConvexPolygon() { im.d.Dirty() } -// FillEllipseArc draws an ellipse arc around each point in the IM's queue. Low and high angles are -// in radians. -// -// It empties the queue after. +// FillCircle draws a filled circle around each point in the IM's queue. +func (im *IM) FillCircle(radius float64) { + im.FillEllipse(V(radius, radius)) +} + +// FillEllipse draws a filled ellipse around each point in the IM's queue. +func (im *IM) FillEllipse(radius Vec) { + im.FillEllipseArc(radius, 0, 2*math.Pi) +} + +// FillEllipseArc draws a filled ellipse arc around each point in the IM's queue. Low and high +// angles are in radians. func (im *IM) FillEllipseArc(radius Vec, low, high float64) { points := im.points im.points = nil -- GitLab