aboutsummaryrefslogtreecommitdiff
path: root/src/toolkit/frame.py
diff options
context:
space:
mode:
authorBrianna2017-08-03 21:16:51 -0400
committerGitHub2017-08-03 21:16:51 -0400
commit20905230fe6df814fdaa6173b266dd7de51bd269 (patch)
tree3a95b7e752fcaacaf820229fe99a858e69db022d /src/toolkit/frame.py
parent6f8f178778c63f10b3bda42507c7d44f98884fcd (diff)
parentd04ddba484f1c8993971f79d5ee14b0cc7a512fb (diff)
new Waveform & Spectrum component + relative coords for everything
NOTE: projects and presets saved from old versions will not load correctly anymore
Diffstat (limited to 'src/toolkit/frame.py')
-rw-r--r--src/toolkit/frame.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/toolkit/frame.py b/src/toolkit/frame.py
index b66e037..c007188 100644
--- a/src/toolkit/frame.py
+++ b/src/toolkit/frame.py
@@ -6,6 +6,7 @@ from PIL import Image
from PIL.ImageQt import ImageQt
import sys
import os
+import math
import core
@@ -41,6 +42,17 @@ class PaintColor(QtGui.QColor):
super().__init__(b, g, r, a)
+def scale(scalePercent, width, height, returntype=None):
+ width = (float(width) / 100.0) * float(scalePercent)
+ height = (float(height) / 100.0) * float(scalePercent)
+ if returntype == str:
+ return (str(math.ceil(width)), str(math.ceil(height)))
+ elif returntype == int:
+ return (math.ceil(width), math.ceil(height))
+ else:
+ return (width, height)
+
+
def defaultSize(framefunc):
'''Makes width/height arguments optional'''
def decorator(*args):