1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Fix division by zero when scaling

This commit is contained in:
square
2025-04-16 02:30:25 +02:00
committed by GitHub
parent dbddc9ef29
commit b278cc4837

View File

@@ -2035,7 +2035,14 @@ bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) {
Size2 scale_max; Size2 scale_max;
if (drag_type != DRAG_SCALE_BOTH) { if (drag_type != DRAG_SCALE_BOTH) {
for (CanvasItem *ci : drag_selection) { for (CanvasItem *ci : drag_selection) {
scale_max = scale_max.max(ci->_edit_get_scale()); Size2 scale = ci->_edit_get_scale();
if (Math::abs(scale.x) > Math::abs(scale_max.x)) {
scale_max.x = scale.x;
}
if (Math::abs(scale.y) > Math::abs(scale_max.y)) {
scale_max.y = scale.y;
}
} }
} }