golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.11k stars 17.68k forks source link

x/image/vector: repeat Draw() -> nonsense #68981

Open splace opened 2 months ago

splace commented 2 months ago

Go version

n/a

Output of go env in your module/workspace:

n/a

What did you do?

https://go.dev/play/p/VlCSG5OMtxF

(adapted from package example)

i was trying to draw to two different targets.

What did you see happen?

n/a

What did you expect to see?

no change with repeated Draws

seankhliao commented 2 months ago

I think you should be calling Reset between Draws?

splace commented 2 months ago

I think you should be calling Reset between Draws?

doc says it will remove path, and now tested, that is what reset does.

splace commented 2 months ago

https://go.dev/play/p/DfnYz1Mya2A

if the lower bound of the image, being draw too, is the origin, it works.

maybe something that should be zero, is being left at something else after a draw.

splace commented 2 months ago

https://go.dev/play/p/IkT6qBvHEMJ

and if the target image is a different size, the second draw panics.

same as above? or a different issue?