personalizedrefrigerator / js-draw

Draw pictures using a pen, touchscreen, or mouse! JS-draw is a freehand drawing library for JavaScript and TypeScript.
https://personalizedrefrigerator.github.io/js-draw/typedoc/
MIT License
79 stars 8 forks source link

"fixable" line size #56

Open xXZaretXx opened 8 months ago

xXZaretXx commented 8 months ago

I have started using js-draw in my notes app.

Unfortunately, I found out that the adjustable pen size is not properly taken into account, as it still scales with the zoom level, which makes handwritten notes look really unattractive.

It would be great if you could switch the scaling size on and off with a button in the pen menu, as it is practical in principle.

personalizedrefrigerator commented 8 months ago

Thank you for the feedback!

Other possible solutions

Where possible, I would prefer to avoid adding additional buttons to the toolbar.

Here are some alternative solutions:

  1. Implement zoom snapping: just as the canvas rotation snaps to 90°, 180°, ..., zoom could snap to 25%, 50%, 100%, 200%, 400%, ... .
  2. Add an option to js-draw's configuration object to disable auto-resizing tools.
  3. Add the new button to the "Page" or "Hand" menus and make it apply to all tools.
  4. Making it more difficult to accidentally zoom
    • Users writing with a stylus can currently enable "Touchscreen panning" to make 1-finger touchscreen gestures pan, rather than draw.

Rationale for changing line size

One of js-draw's goals is to support zoom from 10-10x to 1010x. Not having auto-resizing tools makes editing drawings that use this feature difficult.

Other possible causes of messy/hard-to-read strokes

It's also possible that the messyness of handwritten notes is related to:

personalizedrefrigerator commented 8 months ago

I've implemented zoom snapping in 0378b9de76222aa608b71fc05d3f5be2b4ffd659, however, I don't think it's sufficient to solve this issue.

xXZaretXx commented 8 months ago

I've implemented zoom snapping in 0378b9d, however, I don't think it's sufficient to solve this issue.

Hi @personalizedrefrigerator thanks for the implementation :) maybe not suffcient but a step for a better usabality for writings