From 3f2834529fc31e0f00440237dd4a0a374f378718 Mon Sep 17 00:00:00 2001 From: tassaron Date: Sat, 12 Aug 2017 23:03:56 -0400 Subject: [PATCH] fix --- src/toolkit/frame.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/toolkit/frame.py b/src/toolkit/frame.py index 6174072..63774a6 100644 --- a/src/toolkit/frame.py +++ b/src/toolkit/frame.py @@ -32,12 +32,12 @@ class FramePainter(QtGui.QPainter): super().setPen(penStyle) def finalize(self): - self.end() imBytes = self.image.bits().asstring(self.image.byteCount()) - - return Image.frombytes( + frame = Image.frombytes( 'RGBA', (self.image.width(), self.image.height()), imBytes ) + self.end() + return frame class PaintColor(QtGui.QColor): @@ -78,19 +78,14 @@ def defaultSize(framefunc): def FloodFrame(width, height, RgbaTuple): log.debug('Creating new %s*%s %s flood frame' % ( - width, height, - 'blank' if RgbaTuple[3] == 0 else RgbaTuple - ) - ) + width, height, RgbaTuple)) return Image.new("RGBA", (width, height), RgbaTuple) @defaultSize def BlankFrame(width, height): '''The base frame used by each component to start drawing.''' - newFrame = FloodFrame(width, height, (0, 0, 0, 0)) - blankFrames[(width, height)] = newFrame - return newFrame + return FloodFrame(width, height, (0, 0, 0, 0)) @defaultSize @@ -106,5 +101,4 @@ def Checkerboard(width, height): (0, 0) ) image = image.resize((width, height)) - checkerboards[(width, height)] = image return image