mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Clamp the editor scale to 1 when resetting zoom in the 2D editor
This closes #35294.
This commit is contained in:
parent
d4a222cd9d
commit
c9aca9ef81
@ -4236,7 +4236,7 @@ void CanvasItemEditor::_button_zoom_minus() {
|
||||
}
|
||||
|
||||
void CanvasItemEditor::_button_zoom_reset() {
|
||||
_zoom_on_position(1.0 * EDSCALE, viewport_scrollable->get_size() / 2.0);
|
||||
_zoom_on_position(1.0 * MAX(1, EDSCALE), viewport_scrollable->get_size() / 2.0);
|
||||
}
|
||||
|
||||
void CanvasItemEditor::_button_zoom_plus() {
|
||||
@ -5038,7 +5038,7 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
|
||||
if (state.has("zoom")) {
|
||||
// Compensate the editor scale, so that the editor scale can be changed
|
||||
// and the zoom level will still be the same (relative to the editor scale).
|
||||
zoom = float(p_state["zoom"]) * EDSCALE;
|
||||
zoom = float(p_state["zoom"]) * MAX(1, EDSCALE);
|
||||
_update_zoom_label();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user