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:
parent
5e1c9dc73b
commit
489749e305
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue