diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-18 14:16:37 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-18 14:16:37 +0200 |
commit | 78c665af8b860063658d1782f75e072cfe88c82b (patch) | |
tree | 5d49d4894bb3363a336bfc44f3306646a1639e5b /src/sliceitoff/display | |
parent | b99e522de33bc97e193a51692db856f586921286 (diff) |
area percent calculation
Diffstat (limited to 'src/sliceitoff/display')
-rw-r--r-- | src/sliceitoff/display/scaling.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |