summaryrefslogtreecommitdiff
path: root/src/zoom.py
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-08-31 21:00:30 +0200
committerRaindropsSys <contact@minteck.org>2023-08-31 21:00:30 +0200
commite54ac640f1d3f7071a48032e924b04529cbd358f (patch)
tree91efa742451921231e0695a5b5c99a1c4fac19f9 /src/zoom.py
downloadblocks-e54ac640f1d3f7071a48032e924b04529cbd358f.tar.gz
blocks-e54ac640f1d3f7071a48032e924b04529cbd358f.tar.bz2
blocks-e54ac640f1d3f7071a48032e924b04529cbd358f.zip
Initial commit
Diffstat (limited to 'src/zoom.py')
-rw-r--r--src/zoom.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/zoom.py b/src/zoom.py
new file mode 100644
index 0000000..2f993a3
--- /dev/null
+++ b/src/zoom.py
@@ -0,0 +1,30 @@
+def zoom_in(zoom):
+ if zoom[0] > 128:
+ zoom = (zoom[0] / 1.5, zoom[1] / 1.5)
+ return zoom
+
+def zoom_out(zoom):
+ if zoom[0] < 1280:
+ zoom = (zoom[0] * 1.5, zoom[1] * 1.5)
+ return zoom
+
+def zoom_reset(zoom, offset):
+ zoom = (1280.0, 720.0)
+ offset = (0, 0)
+ return zoom, offset
+
+def offset_up(offset):
+ offset = (offset[0], offset[1] - 10)
+ return offset
+
+def offset_down(offset):
+ offset = (offset[0], offset[1] + 10)
+ return offset
+
+def offset_left(offset):
+ offset = (offset[0] - 10, offset[1])
+ return offset
+
+def offset_right(offset):
+ offset = (offset[0] + 10, offset[1])
+ return offset \ No newline at end of file