scratchfoundation / scratch-paint

Paint editor for Scratch 3.0
https://llk.github.io/scratch-paint/
BSD 3-Clause "New" or "Revised" License
173 stars 221 forks source link

Replace the cursor with the fill bucket icon when in fill mode #358

Open fsih opened 6 years ago

fsih commented 6 years ago

Whenever the fill tool is active and the mouse is over the paint canvas, the usual mouse cursor should disappear, and be replaced with the fill tool icon (located at scratch-paint/src/components/fill-mode/fill.svg)

The icon should be lined up with the pointer location like this: image

/cc @carljbowman

Jacco commented 6 years ago

I have been thinking about this feature. And there are a few things that might need some discussion:

If the actual cursor is hidden and a moving icon is shown using the suggested svg object on the paper canvas a few issues arise:

Most of these issues can be solved by creating a new svg.

It is for most browsers also possible to set custom cursors (css property cursor with a url value). These will not have the edge problems.

Also I would like to suggest a feature:

Css code:

  cursor: url(page date url here) 25 10, auto;

You can create data url here: dataurl

fsih commented 6 years ago

I agree we should use the CSS cursor property. An easy way to get to it is paper.view.element.style.cursor =

I think you're right that we might want to adjust the fill icon a bit to make it work better as a cursor

Since this needs some design, I will take off help wanted for now and put it back on when we have that ready.

For the paint bucket showing the color that's going to be applied, I think that's a cool idea! You should file it as a feature request.

/cc @carljbowman

fsih commented 6 years ago

Here is the new cursor file we would like to use! fill-cursor.zip