summaryrefslogtreecommitdiff
path: root/src/sliceitoff/display/scaling.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff/display/scaling.py')
-rw-r--r--src/sliceitoff/display/scaling.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sliceitoff/display/scaling.py b/src/sliceitoff/display/scaling.py
index ddc897f..b4292b4 100644
--- a/src/sliceitoff/display/scaling.py
+++ b/src/sliceitoff/display/scaling.py
@@ -1,8 +1,11 @@
+""" display.scaling - for converting internal resolution to actual screen """
+
import pygame
from .static import INTERNAL_WIDTH, INTERNAL_HEIGHT
class Scaling():
+ """ Holds data and methods needed for coordinate conversion """
factor = 0.02
left = 0
top = 0
@@ -10,7 +13,7 @@ class Scaling():
center = (0,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:
""" converts area coordinates to pygame.Rect"""
@@ -40,6 +43,8 @@ class Scaling():
@staticmethod
def update_scaling(size: tuple) -> None:
+ """ Calculates new scaling and positionin according given
+ actual resolution """
__class__.resolution = size
__class__.center = (size[0]/2,size[1]/2)
if size[0] / size[1] <= INTERNAL_WIDTH / INTERNAL_HEIGHT: