Skip to content

Conversation

@WesleyClements
Copy link
Contributor

This pull request changes the sprite sheet zoom reset behavior in the SpriteFramesEditor to have a larger default for smaller sprites. Specifically, sprites will be scaled up as much as possible without overflowing the display area. The behavior for larger sprites is unchanged. This addresses part of what was discussed in godotengine/godot-proposals#7021 in that "better" defaults for zoom reduce the need to store user preferences.

The largest change is to SpriteFramesEditor::_sheet_zoom_reset. Instead of zoom always resetting to a minimum of 1.0, the minimum value increases to an integer value based on the ratio of the texture size to the display area size. If the sprite can be scaled up by 2 while still fitting, it will. If it can be scaled up by 3, it will. Etc.

The second change is to when SpriteFramesEditor::_sheet_zoom_reset is called during loading of a new texture. Due to the pop up dialogue not knowing it's size until after it has popped up and been drawn once, the calculations in SpriteFramesEditor::_sheet_zoom_reset wouldn't be accurate for the first pop up. This resulted in all sprites having zoom 1.0 on that first popup, regardless of size. To remedy this, I changed SpriteFramesEditor::_sheet_zoom_reset to be triggered by a one shot signal after the popup has been shown.

@WesleyClements WesleyClements requested a review from a team as a code owner October 10, 2025 08:47
@AThousandShips AThousandShips changed the title Increased default zoom for small sprite sheets in SpriteFramesEditor Increase default zoom for small sprite sheets in SpriteFramesEditor Oct 10, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Oct 10, 2025
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.

2 participants