This commit is contained in:
Michael Fogleman 2016-02-19 21:00:56 -05:00
parent 4ce170694c
commit 43258d7dd7
2 changed files with 8 additions and 1 deletions

View File

@ -94,6 +94,7 @@ Rotate(angle float64)
RotateAbout(angle, x, y float64)
Shear(x, y float64)
TransformPoint(x, y float64) (tx, ty float64)
InvertY()
Push()
Pop()
```

View File

@ -257,7 +257,8 @@ func (dc *Context) Fill() {
// Convenient Drawing Functions
func (dc *Context) Clear() {
draw.Draw(dc.im, dc.im.Bounds(), image.NewUniform(dc.color), image.ZP, draw.Src)
src := image.NewUniform(dc.color)
draw.Draw(dc.im, dc.im.Bounds(), src, image.ZP, draw.Src)
}
func (dc *Context) DrawLine(x1, y1, x2, y2 float64) {
@ -375,6 +376,11 @@ func (dc *Context) TransformPoint(x, y float64) (tx, ty float64) {
return dc.matrix.TransformPoint(x, y)
}
func (dc *Context) InvertY() {
dc.Translate(0, float64(dc.height))
dc.Scale(1, -1)
}
// Stack
func (dc *Context) Push() {