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:
Dan Buch 2012-12-21 09:19:35 -05:00
parent be0c529381
commit 809e5ae69e

View File

@ -90,7 +90,9 @@ func (me *Canvas) Rectangle(x, y, halfWidth, halfHeight float64) error {
return nil 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) &image.Uniform{image.White}, image.ZP, draw.Src)
return nil return nil