summaryrefslogtreecommitdiffstats
path: root/Camera.gd
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-07-15 10:54:33 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-07-15 10:54:33 +0200
commit9274d1351f527de8ccee89eaccea1cf5dc141756 (patch)
tree9c9cbde594d5a9b2b264178b57eb29843beb1eca /Camera.gd
parent069071ad40850f2880367885a3100676f716030d (diff)
downloadgodot-hexgrid-9274d1351f527de8ccee89eaccea1cf5dc141756.zip
godot-hexgrid-9274d1351f527de8ccee89eaccea1cf5dc141756.tar.gz
Camera : adapt zoom_boundaries
Diffstat (limited to 'Camera.gd')
-rw-r--r--Camera.gd3
1 files changed, 2 insertions, 1 deletions
diff --git a/Camera.gd b/Camera.gd
index 694706e..0dc6074 100644
--- a/Camera.gd
+++ b/Camera.gd
@@ -13,7 +13,8 @@ func configure(w : Vector2, c : Vector2, ts : Vector2) -> void:
window = w
map_center = c
texture_size = ts
- zoom_boundaries = Vector2(1.0, max((texture_size.x + margin.x) / window.x, (texture_size.y + margin.y) / window.y))
+ var zout : float = max((texture_size.x + margin.x) / window.x, (texture_size.y + margin.y) / window.y)
+ zoom_boundaries = Vector2(zout - 0.5, zout)
update_camera(0, 0, zoom_boundaries.y)
func update_camera(x : float, y : float, z : float) -> void: