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

Fix rubberbanding on wx+py3.10. by anntzer · Pull Request #21990 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) 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
3 changes: 2 additions & 1 deletion lib/matplotlib/backends/backend_wx.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 @@ -618,7 +618,8 @@ def gui_repaint(self, drawDC=None, origin='WX'):
else self.bitmap)
drawDC.DrawBitmap(bmp, 0, 0)
if self._rubberband_rect is not None:
x0, y0, x1, y1 = self._rubberband_rect
# Some versions of wx+python don't support numpy.float64 here.
x0, y0, x1, y1 = map(int, self._rubberband_rect)
drawDC.DrawLineList(
[(x0, y0, x1, y0), (x1, y0, x1, y1),
(x0, y0, x0, y1), (x0, y1, x1, y1)],
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_backends_interactive.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 @@ -128,6 +128,8 @@ def check_alt_backend(alt_backend):
"matplotlib.backends.backend_{}".format(backend))

ax.plot([0, 1], [2, 3])
if fig.canvas.toolbar: # i.e toolbar2.
fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

codecov claims this line isn't being tested - is that a CI issue or is the if statement never being executed anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

At least locally, I can confirm that this is indeed executed...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This line is run for all backends, and we skip a few, so it seems to be referring to that.


timer = fig.canvas.new_timer(1.) # Test floats casting to int as needed.
timer.add_callback(FigureCanvasBase.key_press_event, fig.canvas, "q")
Expand Down

Back | FazBrowse Home | New Git URL