Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
15c980cf
Commit
15c980cf
authored
Nov 08, 2011
by
Duane Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix black background / transparency issue in Windows/Linux
parent
3722b11a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
bufferedcanvas.py
bufferedcanvas.py
+13
-9
No files found.
bufferedcanvas.py
View file @
15c980cf
...
@@ -111,13 +111,21 @@ class BufferedCanvas(wx.Panel):
...
@@ -111,13 +111,21 @@ class BufferedCanvas(wx.Panel):
Causes the canvas to be updated.
Causes the canvas to be updated.
"""
"""
dc
=
wx
.
MemoryDC
()
dc
=
wx
.
MemoryDC
()
width
,
height
=
self
.
GetClientSizeTuple
()
width
,
height
=
self
.
getWidthHeight
()
self
.
backbuffer
=
wx
.
EmptyBitmap
(
width
,
height
)
self
.
backbuffer
=
wx
.
EmptyBitmap
RGBA
(
width
,
height
,
alpha
=
0
)
dc
.
SelectObject
(
self
.
backbuffer
)
dc
.
SelectObject
(
self
.
backbuffer
)
dc
.
BeginDrawing
()
dc
.
BeginDrawing
()
self
.
draw
(
dc
)
self
.
draw
(
dc
)
dc
.
EndDrawing
()
dc
.
EndDrawing
()
self
.
flip
()
self
.
flip
()
def
getWidthHeight
(
self
):
width
,
height
=
self
.
GetClientSizeTuple
()
if
width
==
0
:
width
=
1
if
height
==
0
:
height
=
1
return
(
width
,
height
)
##
##
## Event handlers
## Event handlers
...
@@ -131,13 +139,9 @@ class BufferedCanvas(wx.Panel):
...
@@ -131,13 +139,9 @@ class BufferedCanvas(wx.Panel):
def
onSize
(
self
,
event
):
def
onSize
(
self
,
event
):
# Here we need to create a new off-screen buffer to hold
# Here we need to create a new off-screen buffer to hold
# the in-progress drawings on.
# the in-progress drawings on.
width
,
height
=
self
.
GetClientSizeTuple
()
w
,
h
=
self
.
getWidthHeight
()
if
width
==
0
:
self
.
buffer
=
wx
.
EmptyBitmapRGBA
(
w
,
h
,
alpha
=
0
)
width
=
1
self
.
backbuffer
=
wx
.
EmptyBitmapRGBA
(
w
,
h
,
alpha
=
0
)
if
height
==
0
:
height
=
1
self
.
buffer
=
wx
.
EmptyBitmap
(
width
,
height
)
self
.
backbuffer
=
wx
.
EmptyBitmap
(
width
,
height
)
# Now update the screen
# Now update the screen
self
.
update
()
self
.
update
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment