jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
688 stars 64 forks source link

how to drag an image around on the canvas? #309

Closed bhomass closed 1 year ago

bhomass commented 1 year ago

I am able to draw an image, then re-draw in the new mouse postion, but the image remains in the last positions, so it smears all over the canvas. I don't see a method for remove the last draw image, and I don't want to call clear() to clear the entire canvas. Please advice how to accomplish this.

martinRenou commented 1 year ago

I don't want to call clear() to clear the entire canvas

You can use clear_rect for removing part of the canvas.

bhomass commented 1 year ago

thank you. worked!