1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Fix division by zero crash

This commit is contained in:
Manolis Papadeas 2021-06-01 18:43:23 +03:00
parent 5e1c9dc73b
commit 489749e305

View file

@ -224,6 +224,7 @@ func fit_to_frame(size : Vector2) -> void:
v_ratio = Global.main_viewport.rect_size.y / size.y
ratio = min(h_ratio, v_ratio)
ratio = clamp(ratio, 0.1, ratio)
zoom = Vector2(1 / ratio, 1 / ratio)
offset = size / 2
zoom_changed()