From ccde3a89238f399c33aa59141d12937e51f3a40f Mon Sep 17 00:00:00 2001 From: Jamie Crisman Date: Thu, 24 Jan 2019 14:20:04 -0600 Subject: [PATCH] Allows the ability to get the current point in the context --- context.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/context.go b/context.go index 49d1714..316a7c1 100644 --- a/context.go +++ b/context.go @@ -110,6 +110,15 @@ func NewContextForRGBA(im *image.RGBA) *Context { } } +// GetCurrentPoint will return the current point and if there is a current point. +// The point will have been transformed by the context's transformation matrix. +func (dc *Context) GetCurrentPoint() (Point, bool) { + if dc.hasCurrent { + return dc.current, true + } + return Point{}, false +} + // Image returns the image that has been drawn by this context. func (dc *Context) Image() image.Image { return dc.im