OSDN Git Service
(root)
/
mypaint-anime
/
master.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
285deb7
)
Copying from a blank doc makes no sense, don't try
author
Andrew Chadwick
<andrewc-git@piffle.org>
Sat, 9 Jan 2010 00:15:28 +0000
(
00:15
+0000)
committer
Martin Renold
<martinxyz@gmx.ch>
Sat, 9 Jan 2010 09:41:30 +0000
(10:41 +0100)
gui/drawwindow.py
patch
|
blob
|
history
diff --git
a/gui/drawwindow.py
b/gui/drawwindow.py
index
d3b7456
..
0c34591
100644
(file)
--- a/
gui/drawwindow.py
+++ b/
gui/drawwindow.py
@@
-294,7
+294,11
@@
class Window(gtk.Window):
def copy_cb(self, action):
# use the full document bbox, so we can past layers back to the correct position
bbox = self.doc.get_bbox()
- pixbuf = self.doc.layer.surface.render_as_pixbuf(*bbox)
+ if bbox.w == 0 or bbox.h == 0:
+ print "WARNING: empty document, nothing copied"
+ return
+ else:
+ pixbuf = self.doc.layer.surface.render_as_pixbuf(*bbox)
cb = gtk.Clipboard()
cb.set_image(pixbuf)