aboutsummaryrefslogtreecommitdiff
path: root/src/toolkit/frame.py
diff options
context:
space:
mode:
authortassaron2017-07-29 20:27:46 -0400
committertassaron2017-07-29 20:27:46 -0400
commit1297af61c9ce00b6dd76f8ec690baedf5bf887c7 (patch)
tree8861afa599674fb3d6ee312baf035fa7446f242b /src/toolkit/frame.py
parentc1457b6dad4640b17679dd802e372bd46a13d2a5 (diff)
waveform component is working, preview is glitchy
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..f42d4c9 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(scale, width, height, returntype=None):
+ width = (float(width) / 100.0) * float(scale)
+ height = (float(height) / 100.0) * float(scale)
+ 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):