diff options
| author | tassaron | 2017-08-12 23:03:56 -0400 |
|---|---|---|
| committer | tassaron | 2017-08-12 23:03:56 -0400 |
| commit | 3f2834529fc31e0f00440237dd4a0a374f378718 (patch) | |
| tree | 5707391130bf820895e73d5d6277399aececc8e2 /src | |
| parent | d6b6083f80ae609c801ef63285718325cd71d0c9 (diff) | |
fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/toolkit/frame.py | 16 |
1 files 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 |
