Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06301b8

Browse files
committed
Fixing Qt/Qt4 blit shearing problem
svn path=/trunk/matplotlib/; revision=4995
1 parent a9b2763 commit 06301b8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/matplotlib/backends/backend_qt4agg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ def paintEvent( self, e ):
109109
# we are blitting here
110110
else:
111111
bbox = self.replot
112-
l, b, w, h = bbox.bounds
113-
t = b + h
112+
l, b, r, t = bbox.extents
113+
w = int(r) - int(l)
114+
h = int(t) - int(b)
114115
reg = self.copy_from_bbox(bbox)
115116
stringBuffer = reg.to_string()
116117
qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32)

lib/matplotlib/backends/backend_qtagg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ def paintEvent( self, e ):
115115
# we are blitting here
116116
else:
117117
bbox = self.replot
118-
l, b, w, h = bbox.bounds
119-
t = b + h
118+
l, b, r, t = bbox.extents
119+
w = int(r) - int(l)
120+
h = int(t) - int(b)
120121
reg = self.copy_from_bbox(bbox)
121122
stringBuffer = reg.to_string()
122123
qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian)

0 commit comments

Comments
 (0)