Just stick a call to graphics.clear() before you call graphics.beginGradientFill(). I tested that and it should get it to work. Got to make sure you're drawing from a clean slate.

Doug

ben.clinkinbeard wrote:

Hello, I have created a simple subclass of Canvas that allows rounded
corners and a gradient background, but its position is not being
updated correctly. When binding its width to the width of a child
textfield, it only sizes correctly when the width increases. When the
child textfield's width decreases, my custom canvas stays the same
size (but its position is updated as if the size were adjusted
correctly). A simple demo with source can be seen here:

http://returnundefined.com/files/RecessedCanvasDemo/RecessedCanvasDemo.html <http://returnundefined.com/files/RecessedCanvasDemo/RecessedCanvasDemo.html>

I am assuming I am missing a call to invalidateSize() or something but
nothing I've tried has helped.

TIA,
Ben


Reply via email to