You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually, image manipulation programs allow to assign different colors to the left and right mouse buttons. It would be great if this was also supported by dotting. Right now, only a single color can be set, which is drawn with both left or right mouse buttons.
The text was updated successfully, but these errors were encountered:
I did not quite understand this feature request. From what I know, the color selection needs to be programmed by the user (the developer can freely set the brush color logic using the brushColor prop in Dotting) Maybe you could implement your own mouse logic for your program for the right mouse button? Please notify me if I understood it wrong.
Thank you @hunkim98, that did the trick. I did not think of this possibility.
For reference, here's my solution. I wrapped Dotting in a div that sets the brush color to a secondary color on right mouse button click (onContextMenu), and sets the brush color back to a primary color when the mouse button is lifted (onMouseUp).
I spoke too soon unfortunately. Above solution works fine when right-clicking and dragging the mouse to draw multiple pixels at once, but when right-clicking without dragging the mouse to draw only a single pixel, then it does not. Apparently, the pixel is drawn to the canvas and only after that, the onContextMenu listener on the wrapping div is executed.
I tried a few alternative ways like using onMouseDown instead of onContextMenu, or setting the eventlistener directly on the dottingRef using addCanvasElementEventListener. But it was the same problem every time.
Perhaps, this needs to be adressed by Dotting after all.
Usually, image manipulation programs allow to assign different colors to the left and right mouse buttons. It would be great if this was also supported by dotting. Right now, only a single color can be set, which is drawn with both left or right mouse buttons.
The text was updated successfully, but these errors were encountered: