Improvements to Zoom and Drag #221
Merged
+366
−107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Clicking the "focus" button will make sure all of the components fit within the current view window.
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.