diff options
Diffstat (limited to 'src/sliceitoff/display/scaling.py')
-rw-r--r-- | src/sliceitoff/display/scaling.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/sliceitoff/display/scaling.py b/src/sliceitoff/display/scaling.py index af307d1..f40d33c 100644 --- a/src/sliceitoff/display/scaling.py +++ b/src/sliceitoff/display/scaling.py @@ -6,6 +6,8 @@ class Scaling(): factor = 0.02 left = 0 top = 0 + borders = (pygame.Rect(0,0,0,0), pygame.Rect(0,0,0,0)) + active = pygame.Rect(0,0,0,0) @staticmethod def area_to_rect(area: tuple) -> pygame.Rect: @@ -40,8 +42,36 @@ class Scaling(): __class__.factor = size[0] / INTERNAL_WIDTH __class__.left = 0 __class__.top = (size[1] - INTERNAL_HEIGHT * __class__.factor) // 2 + __class__.border = ( + pygame.Rect( + 0, + 0, + size[0], + __class__.top), + pygame.Rect( + 0, + size[1] - __class__.top, + size[0], + __class__.top), + ) else: __class__.factor = size[1] / INTERNAL_HEIGHT __class__.left = (size[0] - INTERNAL_WIDTH * __class__.factor) // 2 __class__.top = 0 -
\ No newline at end of file + __class__.border = ( + pygame.Rect( + 0, + 0, + __class__.left, + size[1]), + pygame.Rect( + size[0] - __class__.left, + 0, + __class__.left, + size[1]), + ) + __class__.active = pygame.Rect( + __class__.left, + __class__.top, + INTERNAL_WIDTH * __class__.factor, + INTERNAL_HEIGHT * __class__.factor) |