InvertY
This commit is contained in:
parent
4ce170694c
commit
43258d7dd7
@ -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()
|
||||
```
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user