-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Improve 2D editor zoom logic #48252
Improve 2D editor zoom logic #48252
Conversation
OK this is even better - simply pressing 1-9, without using Control, to alter zoom. Two questions:
|
Yes, this is already done 🙂
No, these only work if the 2D editor viewport is focused. Making them work even if the 2D editor viewport isn't focused might be possible in |
I am not really sold on the proposal. This is a lot of shortcuts for something that simply requires pressing Ctrl+'+' or Ctrl+'-' otherwise. And I'm not sure we need that amount of different values with one key each. I think it would make more sense to make those 1-9 keys switch between scenes for example. |
Interesting idea for number row keys 1 through 0 to be mapped to scene tabs. I think I would actually use that. If the consensus is for 1 - 0 to be mapped to scene tabs, I still suggest CTRL+[number] for specific zoom shortcuts. And at the very least, as part of this proposal - ALT+SCROLLWHEEL will snap to integer zoom values. A big improvement, imo. |
The difference is that there's no way to jump to zoom values, while you have all scene tabs available at once. No reason to switch them with number if you can just click them. That said, the "1" shortcut is the same as clicking zoom label, but personally I also use it to reset zoom 🤔 EDIT: |
We need both shortcuts until support for multiple editor shortcuts is implemented. (Otherwise, I have to hardcode one of them which isn't great.) |
I mean, if Reset Zoom and Zoom 100% is the same thing, we don't need both. I'd just remove Ctrl+0, as 1 is easier to use anyways. |
Most applications such as web browsers and code editors support Ctrl + 0 to reset the zoom. Removing that shortcut would break user expectations, but at the same time, removing 1 would also break user expectations for those coming from GIMP. Edit: Rebased and tested again, it works successfully. |
8b5f3fa
to
11c9882
Compare
Wow, that Alt-zoom is so nice to use. I still think that having two functionally identical shortcuts is redundant. We could remove it for now and possibly re-add when the multi-event shortcuts are added. Also, this is inspired by GIMP, but GIMP has actually 5 zoom shortcuts. 1 for 100%, 2 for 200%, 3 for 400%, 4 for 800 and 5 for 1600%. I tried the numerical zooms and, while this is handy, having 9 of them, with 100% increment isn't very useful (especially when Alt+wheel does exactly that). Maybe it could be changed to something closer to GIMP, i.e. less shortcuts and more exponential scale? |
I thought about doing this at first, but I feel like zoom values above 900% aren't often useful in game development. (This is different when editing pixel art, for instance.) |
Then it could stop at |
Adding |
But Alt + wheel already gives 100% increment. Having 9 shortcuts for that would be only useful if you use keyboard only, which is unlikely in the editor. I use GIMP quite a bit and IMO its zoom shortcut scheme is enough.
I know. That's why we could just have 4 shortcuts. Or also 5, but with different increments, e.g. 100/200/400/600/800. |
11c9882
to
8845240
Compare
- Add 1-5 shortcuts to zoom between 100% and 1600% quickly (similar to GIMP). - When holding down Alt, go through integer zoom values if above 100% or fractional zoom values with integer denominators if below 100% (50%, ~33.3%, 25%, …).
8845240
to
43f9699
Compare
I changed the zoom shortcuts to use power-of-two integer factors between 100% and 1600%. It now works the same way it does in GIMP. |
Thanks! |
ED_SHORTCUT("canvas_item_editor/zoom_100_percent", TTR("Zoom To 100%"), KEY_1); | ||
ED_SHORTCUT("canvas_item_editor/zoom_200_percent", TTR("Zoom To 200%"), KEY_2); | ||
ED_SHORTCUT("canvas_item_editor/zoom_400_percent", TTR("Zoom To 400%"), KEY_3); | ||
ED_SHORTCUT("canvas_item_editor/zoom_800_percent", TTR("Zoom To 800%"), KEY_4); | ||
ED_SHORTCUT("canvas_item_editor/zoom_1600_percent", TTR("Zoom To 1600%"), KEY_5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the correct capitalization would be "Zoom to 100%", etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: #50418
Could probably use a dedicated PR for |
master
version of #50490.This closes godotengine/godot-proposals#2658.