Skip to content

Implement zooming functionality for all canvas nodes #48

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 4 commits into from
Mar 22, 2024

Conversation

Mideks
Copy link
Contributor

@Mideks Mideks commented Mar 1, 2024

  • Enable proportional scaling of all media attachments (images, videos, audio, PDFs), text blocks, and even Markdown files on the canvas using modifier key + mouse wheel, provided that these elements are not selected or focused for editing.
  • Introduce the ability to undo node scaling via ctrl+z, as if you were undoing the scaling action performed with the mouse.

Note: Due to ongoing issue #47, normal scaling is temporarily restricted to use with the Alt key.

Related to: #37

Mideks and others added 4 commits March 1, 2024 14:29
- Enable proportional scaling of all media attachments (images, videos, audio, PDFs), text blocks, and even Markdown files on the canvas using modifier key + mouse wheel, provided that these elements are not selected or focused for editing.
- Introduce the ability to undo node scaling via ctrl+z, as if you were undoing the scaling action performed with the mouse.

Note: Due to ongoing issue nicojeske#47, normal scaling is temporarily restricted to use with the Alt key.

Related to: nicojeske#37
Moving away from deprecated code and fix typing errors (unfortunately by setting the types to any... as there are not type definitions for canvas yet...)
Partly fixes nicojeske#47. We now also disable scrolling on the `wheel` event if we hover over a canvas element, canvas node or image.

This way we still scroll a little bit before the wheel event disables the scrolling but at least we stop scrolling indefinetly.
@nicojeske
Copy link
Owner

Sorry for just now looking at your PR. I tested it and the zooming on the canvas works as expected!

I just did minor changes to remove deprecated warnings and fix typing (unfortunately by just spamming any as there are no type definitions yet for the canvas API).

I also added a little workaround for the problem in #47 that is not perfect, but should at least be usable.

@Mideks
Copy link
Contributor Author

Mideks commented Mar 25, 2024

@nicojeske

unfortunately by just spamming any as there are no type definitions yet for the canvas API

Huh, yes. I did not find any documentation for canvas and I just reverseenering these canvas functions... I can't say it is was easy, but it was an interesting experience.

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.

2 participants