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

Skip to content

Commit a329dcd

Browse files
committed
Fix crash in _draw_rotated_text in Gdk backend.
1 parent 97f7130 commit a329dcd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/backends/backend_gdk.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ def _draw_rotated_text(self, gc, x, y, s, prop, angle):
228228
if x < 0 or y < 0: # window has shrunk and text is off the edge
229229
return
230230

231+
if x + w > self.width or y + h > self.height:
232+
return
233+
231234
key = (x,y,s,angle,hash(prop))
232235
imageVert = self.rotated.get(key)
233236
if imageVert != None:

0 commit comments

Comments
 (0)