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

Added zoom functionality to sprite frames editor plugin #41223

Merged
merged 1 commit into from
Aug 15, 2020

Conversation

javidcf
Copy link
Contributor

@javidcf javidcf commented Aug 13, 2020

Zoom buttons and mouse control added to spritesheet preview and animation frames pane.

Solves godotengine/godot-proposals#1278

The zoom functionality is pretty much the same as in TileSetEditor, just the usual buttons plus the Ctrl+scroll mouse control.

godot_anim_frames_sheet_zoom

It also adds zoom to the frame previsualization panel.

godot_anim_frames_items_zoom

@bruvzg bruvzg added this to the 4.0 milestone Aug 13, 2020
@javidcf javidcf force-pushed the sprite_frames_editor_zoom branch 2 times, most recently from 66ae47f to a67f68b Compare August 13, 2020 11:46
@Calinou Calinou added usability cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Aug 13, 2020
@YeldhamDev
Copy link
Member

All those buttons should have flat enabled.
And would be nice for the "Select Frames" one to be inside the frame and to the left, for consistency with other parts of the editor.

@javidcf
Copy link
Contributor Author

javidcf commented Aug 13, 2020

@YeldhamDev Thanks, I've fixed that now. To get the positioning right (without making a whole lot of changes, i.e. replacing a ScrollContainer with a panel with two scrollbars and custom scroll handling, as is done in other cases) I had to use set_h_size_flags(0) / set_v_size_flags(0), not sure if that is supposed to be valid? But there isn't an explicit enum to get that "default" behavior from fit_child_in_rect.

Btw, in TileSetEditor the zoom buttons are not flat, I could make that change too since it's just a couple of lines but I'm not sure it's appropriate to have it in this commit/PR. Also, in that case the zoom buttons are next to an information sign button ("Display Tile Names") which I'm not sure if should be made flat or not.

@YeldhamDev
Copy link
Member

not sure if that is supposed to be valid?

As far as I'm aware, yes, that's valid.

Btw, in TileSetEditor the zoom buttons are not flat, I could make that change too since it's just a couple of lines but I'm not sure it's appropriate to have it in this commit/PR.

Yes, a separated PR would be better, and yes, the "Display names" button should be flat. In addition, those buttons should also be made flat:
Screenshot_20200813_161334

Zoom buttons and mouse control added to spritesheet preview and animation frames pane.
@akien-mga akien-mga merged commit ac5619f into godotengine:master Aug 15, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

akien-mga commented Sep 24, 2020

Cherry-picked for 3.2.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 24, 2020
@akien-mga
Copy link
Member

Cherry-picked for 3.2.4.

Actually no, there are significant changes between 3.2 and master which make this non-trivial to cherry-pick, so I'm not confident that what I've done would actually work as designed. So a dedicated PR would be welcome if this change should be backported to the 3.2 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants