Skip to content

feat: add coordinates to preview #737

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 5 commits into from
Jun 18, 2023

Conversation

Logon27
Copy link
Contributor

@Logon27 Logon27 commented Jun 5, 2023

This feature was made in to address issue #289

Added Coordinates to preview. Press P to copy. There is a toggle for the coordinates in the settings. I added a video showing how the feature works. There will likely need to be some revisions to how the canvas is element is referenced. As well as probably some React best practices as this is fairly new to me.

@aarthificial whenever you have time to review, feel free.

(Video is outdated. Will be updated when comments are resolved.)
2023-06-05 19-36-49.webm

@Logon27 Logon27 requested a review from aarthificial as a code owner June 5, 2023 23:45
Comment on lines 33 to 34
{key: 'v', action: 'Toggle coordinates'},
{key: 'c', action: 'Copy coordinates'},
Copy link
Contributor

@aarthificial aarthificial Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of adding multiple shortcuts to do one thing.
I'd imagine it working the same way as the color picker, so:

  1. Initial State - the coordinates are displayed in the top left, next to a button
    a. Clicking on the button switches to the Sampling State
    b. Pressing v switches to the Sampling State
  2. Sampling State
    a. Clicking LMB anywhere on the canvas copies the position.
    b. Clicking ESC cancels sampling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought I would add a toggle to turn the coordinates off in case someone did not want to see them. Do you want the coordinates always displayed?

Copy link
Contributor

@aarthificial aarthificial Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we could also go this way.
If you think hiding the coordinates can be useful then we can add it as a checkbox in the application settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the coordinates as a toggle in the settings. I did not make it a select button like the color picker. Currently its just a keybind to copy the coordinates. This is kind of a stretch goal for me if I have the time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarthificial Couple clarity questions if you want it to be a sampling state instead.

For the sampling state do you want the same EyeDropper selection as the color picker? Or do you want something different?

What svg icon would you like for the button itself?

Added Coordinates to preview. C to copy. V to toggle.
@Logon27 Logon27 force-pushed the feature/coordinates branch from c0572f1 to 78ad0b2 Compare June 6, 2023 02:37
@aarthificial aarthificial merged commit 330c1f9 into motion-canvas:main Jun 18, 2023
@aarthificial aarthificial mentioned this pull request Oct 4, 2023
4 tasks
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.

3 participants