Fixing rectangle drawing
which was broken because I was treating the 3rd and 4th args to `image.Rect` as width and height rather than end coords.
This commit is contained in:
parent
be0c529381
commit
809e5ae69e
@ -90,7 +90,9 @@ func (me *Canvas) Rectangle(x, y, halfWidth, halfHeight float64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
draw.Draw(me.img, image.Rect(int(xs-ws/f2), int(ys-hs/f2), int(ws), int(hs)),
|
||||
originX, originY := int(xs-ws/f2), int(ys-hs/f2)
|
||||
draw.Draw(me.img,
|
||||
image.Rect(originX, originY, originX+int(ws), originY+int(hs)),
|
||||
&image.Uniform{image.White}, image.ZP, draw.Src)
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user