1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fix integer camera zoom going smaller than 100%

This commit is contained in:
Emmanouil Papadeas 2024-05-05 18:14:17 +03:00
parent 645e09701e
commit 8414f3deaf

View file

@ -117,10 +117,13 @@ func zoom_camera(dir: int) -> void:
var zoom_margin := zoom * dir / 10
if Global.integer_zoom:
zoom_margin = (Vector2.ONE * dir).floor()
if zoom + zoom_margin < zoom_in_max:
if zoom + zoom_margin <= zoom_in_max:
zoom += zoom_margin
if zoom < zoom_out_max:
zoom = zoom_out_max
if Global.integer_zoom:
zoom = Vector2.ONE
else:
zoom = zoom_out_max
offset = (
offset
+ (