8000 add alt modifier to ellipse tool by RobertMueller2 · Pull Request #165 · gabm/Satty · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add alt modifier to ellipse tool #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 3, 2025
Merged

Conversation

RobertMueller2
Copy link
Collaborator
@RobertMueller2 RobertMueller2 commented May 2, 2025

Closes #125

This allows dragging circle from corner.

Ctrl+shift draws a circle from corner.

circle_corner

I suppose we could think about swapping around control and not control.

This allows dragging circle from corner.

Ctrl+shift draws a circle from corner.
@gabm
Copy link
Owner
gabm commented May 3, 2025

looks great, that was a comment on reddit yesterday :)

I have two questions

  • does this match the logic of other tools (default vs. shift vs. Ctrl)? two come to mind: PowerPoint and Excalidraw)
  • what happens if you drop the modifier midway? e.g. start with Ctrl, let it go and then press it again?

@RobertMueller2
Copy link
Collaborator Author
RobertMueller2 commented May 3, 2025

Re 1: yeah, I thought I might have to rework that. 😄 I only have access to powerpoint online.

  • powerpoint: has no modifier keys and defaults to "from corner" mode
  • Excalidraw
    • defaults to "from corner'
    • uses Alt to use "from center"
    • uses shift to make it a circle
  • Gimp
    • defaults to "from corner'
    • uses Ctrl to use "from center"
    • uses shift to make it a circle

Perhaps I can think of more other apps to check and we might see inconsistencies between alt and ctrl, but it kinda looks like "from corner" should be the default behaviour.

Re 2: since I'm storing the origin in the ellipse, I can start over with whatever the mode is in that very moment. E.g. start with ctrl, it draws "from corner", let go of ctrl, the circle is now drawn "from center" starting with the original origin. That behaviour matches Excalidraw and Gimp.

@gabm
Copy link
Owner
gabm commented May 3, 2025

i don't think we need to check all the other tools.. from corner as default and shift for "circle" are default imho. Let's go with alt for center and that's it?!

Also move calculate shape and add some helper indicators
@RobertMueller2
Copy link
Collaborator Author
RobertMueller2 commented May 3, 2025

That's changed now, using none for "from corner" and alt for "from circle". According to google, Photoshop also seems to use Alt.
circle_corner2

I've added some helper indicators:

  • a "bounds" rect for the "from corner" mode
  • a center mark (circle) for the "from circle" mode, just while dragging.

Felt like a nice addition and helps proving the math isn't terribly bad, but I can take it out again if it's too much. (Would have been nice to use a dashed line, but that seems overly complicated with femtovg). The hardcoding (color/paint width) isn't ideal, but can be revisited if we ever touch other tools.

@RobertMueller2 RobertMueller2 changed the title add ctrl modifier to ellipse tool add alt modifier to ellipse tool May 3, 2025
@gabm gabm merged commit 32369d4 into gabm:main May 3, 2025
3 checks passed
@gabm
Copy link
Owner
gabm commented May 3, 2025

that looks great, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Draw circle from the corner instead of the center?
2 participants
0