edemaine / cocreate

Cocreate Shared Whiteboard/Drawing
MIT License
209 stars 27 forks source link

Point/dot tool #175

Closed edemaine closed 2 years ago

edemaine commented 3 years ago

I've seen lots of applications for a point tool, which just draws a dot where you click. The line segment tool does a good job at faking this (just click and release without dragging), but a point tool could have a separate stroke and fill which would look nicer, and let you make bigger points.

The challenge is we need to specify a radius, but generally we want to repeat that radius. Maybe the default radius is 1/2 or 1/3 of a grid square, and you can set it via alt-dragging? Or we could have a list of sizes in addition to a list of stroke widths...


On the other hand, this is very similar to the ellipse tool. Perhaps that should just be extended somehow? (A default radius, set by selecting an existing ellipse?)

New plan: in ellipse tool, just clicking (without reaching drag tolerance) creates an ellipse with the "current" radii. Selecting an ellipse sets the current radii to match. So you can take time to make one dot (with grid mode off), and then click many more. Maybe diameter of 1 grid square is a good starting value, which means radius = 1/2.

The inconsistency here is that normally to center a dot would require holding Alt... But it's already discontinuous behavior, so maybe OK.

Alternatively, we could remember whether an ellipse was originally specified from center and use that for making dots... but that is weird because there's no visual indicator either way.


Or... scale radius to current line width?