FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement a consistent behavior in TkAgg backend for bad blit bbox by richardsheridan · Pull Request #20887 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions lib/matplotlib/backends/_backend_tk.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def blit(photoimage, aggimage, offsets, bbox=None):

If *bbox* is passed, it defines the region that gets blitted. That region
will be composed with the previous data according to the alpha channel.
Blitting will be clipped to pixels inside the canvas, including silently
doing nothing if the *bbox* region is entirely outside the canvas.

Tcl events must be dispatched to trigger a blit from a non-Tcl thread.
"""
Expand All @@ -92,6 +94,8 @@ def blit(photoimage, aggimage, offsets, bbox=None):
x2 = min(math.ceil(x2), width)
y1 = max(math.floor(y1), 0)
y2 = min(math.ceil(y2), height)
if (x1 > x2) or (y1 > y2):
return
bboxptr = (x1, x2, y1, y2)
comp_rule = TK_PHOTO_COMPOSITE_OVERLAY
else:
Expand Down

Back | FazBrowse Home | New Git URL