From 78c665af8b860063658d1782f75e072cfe88c82b Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Mon, 18 Mar 2024 14:16:37 +0200 Subject: area percent calculation --- src/sliceitoff/display/scaling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sliceitoff/display/scaling.py') diff --git a/src/sliceitoff/display/scaling.py b/src/sliceitoff/display/scaling.py index aad6c18..af307d1 100644 --- a/src/sliceitoff/display/scaling.py +++ b/src/sliceitoff/display/scaling.py @@ -27,10 +27,10 @@ class Scaling(): def scale_to_internal(coords: tuple ) -> tuple: """ Converts display coordinates to internal coodinates """ x = coords[0] - __class__.left - x = max(x, 0) / __class__.factor + x = max(x, 0) // __class__.factor x = min(x, INTERNAL_WIDTH - 1) y = coords[1] - __class__.top - y = max(y, 0) / __class__.factor + y = max(y, 0) // __class__.factor y = min(y, INTERNAL_HEIGHT - 1) return (x, y) -- cgit v1.2.3