Skip to content

Add zoom and pan to block canvas #120

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 3 commits into from
Jul 9, 2024
Merged

Add zoom and pan to block canvas #120

merged 3 commits into from
Jul 9, 2024

Conversation

wnbaum
Copy link
Contributor

@wnbaum wnbaum commented Jul 5, 2024

This adds zooming and panning to the block canvas.

Currently, blocks only change size when they are placed. Is this desired behavior? Or should the blocks shrink/grow as soon as they enter the canvas.

If anyone wants to try this out feedback would be appreciated!

https://phabricator.endlessm.com/T35539

@wnbaum wnbaum requested review from manuq and dylanmccall July 5, 2024 23:21
@manuq
Copy link
Contributor

manuq commented Jul 8, 2024

This is working like a charm already!

Grabacion.de.pantalla.desde.2024-07-08.12-47-33.webm

This also makes the plugin a lot nicer to work in small screens. The infinite canvas is welcome to organize blocks as users wish too.

Is there anything preventing the dragging to be consistent with the 2D viewport? Why the shift modificator instead of middle mouse button?

@manuq manuq closed this Jul 8, 2024
@manuq manuq reopened this Jul 8, 2024
@wnbaum
Copy link
Contributor Author

wnbaum commented Jul 8, 2024

Is there anything preventing the dragging to be consistent with the 2D viewport?

The DragManager is above the node canvas so nodes attached to it aren't scaled with the Window node in the canvas. I feel like it would be a nice touch to get the blocks to change scale when you bring them over the canvas though, I'll see if I can get that to work.

Why the shift modificator instead of middle mouse button?

I was on a trackpad when working on this, and shift-dragging worked the best for panning around. So it makes a bit more accessible that way but I can also have it work with middle mouse button.

Will make some commits.

@wnbaum wnbaum marked this pull request as ready for review July 8, 2024 20:46
@wnbaum
Copy link
Contributor Author

wnbaum commented Jul 8, 2024

It was actually way easier to make these changes than I thought it would be! Partly thanks to @dylanmccall's reorganization of the drag manager.

I really like how it looks now and I think it feels super polished!

@wnbaum
Copy link
Contributor Author

wnbaum commented Jul 9, 2024

Just rebased for the bottom panel update. Working the same as it was! Will merge now.

@wnbaum wnbaum merged commit b5754fc into main Jul 9, 2024
2 checks passed
@wnbaum wnbaum deleted the zoom-and-pan branch July 9, 2024 18:55
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