Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 13237c2

Browse filesBrowse files
committed
Added clarity on bounding box construction.
1 parent 3c5cbd8 commit 13237c2
Copy full SHA for 13237c2

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎lib/matplotlib/backends/backend_qt5agg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5agg.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ def paintEvent(self, event):
4848
left, top = self.mouseEventCoords(rect.topLeft())
4949
# shift the "top" by the height of the image to get the
5050
# correct corner for our coordinate system
51-
top -= height
52-
bbox = Bbox([[left, top], [left + width, top + height]])
53-
# create a buffer using this bounding box
51+
bottom = top - height
52+
# same with the right side of the image
53+
right = left + width
54+
# create a buffer using the image bounding box
55+
bbox = Bbox([[left, bottom], [right, top]])
5456
reg = self.copy_from_bbox(bbox)
5557
buf = cbook._unmultiplied_rgba8888_to_premultiplied_argb32(
5658
memoryview(reg))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.