Skip to content
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

Improvements to Zoom and Drag #221

Merged
merged 10 commits into from
Jan 26, 2025
Merged

Improvements to Zoom and Drag #221

merged 10 commits into from
Jan 26, 2025

Conversation

Devendork
Copy link
Member

resolves #216, resolves #180, resolves part of issue #214 (part 3)

Made several improvements to the view controls:

1. Zoom To Fit
Responded to neon22's request to add a zoom to fit feature that can (a) adjust zoom and scroll such that all notes and operations/drafts are visible and (b) adjust zoom and scroll such that the view is zoomed into the selected components.

Screenshot 2025-01-26 at 4 22 16 PM

Clicking the "focus" button will make sure all of the components fit within the current view window.
Screenshot 2025-01-26 at 4 30 21 PM

2. Maintain View in Zoom In/Out

Currently, when you zoomed in and out it would do this from the origin at the top left of the palette. Now, it does the same thing but adjusts scroll so that whatever point was the top left when you hit zoom will remain the top left point.

3. Drag without Snapping to Top Left of Components.

Backstory: Angular's default Drag and Drop controller does not support the scaled div upon which dragging is taking place. As a result, I translate the mouse point to the scaled space of the palette and then manually set the top left of the component to that point. This meant that the component was always "snapping" to the top left, no matter where in the component you clicked. I updated this behavior such that the point where you click in the component remains the point from which you move the component. I made this work for both operations, drafts, and notes.

@Devendork Devendork linked an issue Jan 26, 2025 that may be closed by this pull request
@Devendork Devendork merged commit faa45bc into main Jan 26, 2025
@Devendork Devendork deleted the 216-zoom-to-fit-in-beta-427 branch January 26, 2025 23:39
@Devendork Devendork restored the 216-zoom-to-fit-in-beta-427 branch January 26, 2025 23:40
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.

Zoom to fit in beta 4.2.7 Zoom out/in not centered
1 participant