1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-25 00:54:19 +00:00

Make Godot shut up about integer divisions

This commit is contained in:
Steffo 2023-10-03 02:08:08 +02:00
parent 4f2a16113e
commit 6f3b0be6cb
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -20,9 +20,9 @@ func _on_viewport_size_changed():
print("[View] Window size is: ", window_size) print("[View] Window size is: ", window_size)
var scaling_factor var scaling_factor
if window_size.x < window_size.y: if window_size.x < window_size.y:
scaling_factor = window_size.x / 270 scaling_factor = window_size.x / 270.0
else: else:
scaling_factor = window_size.y / 480 scaling_factor = window_size.y / 480.0
print("[View] Scaling factor is: ", scaling_factor) print("[View] Scaling factor is: ", scaling_factor)
get_window().set_content_scale_factor(scaling_factor) get_window().set_content_scale_factor(scaling_factor)
game_safe_ui.set_safe_margins(scaling_factor) game_safe_ui.set_safe_margins(scaling_factor)