Merge pull request #61 from JamieCrisman/get-current
Allows the ability to get the current point in the context
This commit is contained in:
commit
0e8122236d
@ -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.
|
// Image returns the image that has been drawn by this context.
|
||||||
func (dc *Context) Image() image.Image {
|
func (dc *Context) Image() image.Image {
|
||||||
return dc.im
|
return dc.im
|
||||||
|
Loading…
Reference in New Issue
Block a user