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 b400edb

Browse filesBrowse files
committed
Merge pull request #4594 from jenshnielsen/fixwx
Revert "WX Monkey patch ClientDC for name changes"
2 parents d58a2a5 + 60faeb6 commit b400edb
Copy full SHA for b400edb

File tree

Expand file treeCollapse file tree

2 files changed

+6
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-8
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ def gui_repaint(self, drawDC=None, origin='WX'):
832832
if self.IsShownOnScreen():
833833
if not drawDC:
834834
# not called from OnPaint use a ClientDC
835-
drawDC = wxc.ClientDC(self)
835+
drawDC = wx.ClientDC(self)
836836

837837
# ensure that canvas has no 'left' over stuff when resizing frame
838838
drawDC.Clear()
@@ -1688,7 +1688,7 @@ def release(self, event):
16881688
def draw_rubberband(self, event, x0, y0, x1, y1):
16891689
# Use an Overlay to draw a rubberband-like bounding box.
16901690

1691-
dc = wxc.ClientDC(self.canvas)
1691+
dc = wx.ClientDC(self.canvas)
16921692
odc = wx.DCOverlay(self.wxoverlay, dc)
16931693
odc.Clear()
16941694

@@ -1721,7 +1721,10 @@ def draw_rubberband(self, event, x0, y0, x1, y1):
17211721
r, g, b, a = color.Get(True)
17221722
color.Set(r, g, b, 0x60)
17231723
dc.SetBrush(wx.Brush(color))
1724-
dc.DrawRectangleRect(rect)
1724+
if wxc.is_phoenix:
1725+
dc.DrawRectangle(rect)
1726+
else:
1727+
dc.DrawRectangleRect(rect)
17251728

17261729
def set_status_bar(self, statbar):
17271730
self.statbar = statbar

‎lib/matplotlib/backends/wx_compat.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/wx_compat.py
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
print(" wxPython version %s was imported." % backend_version)
2929
raise ImportError(missingwx)
3030

31-
# Import ClientCD so we can Monkey patch it.
32-
ClientDC = wx.ClientDC
33-
3431
if is_phoenix:
3532
# define all the wxPython phoenix stuff
3633

@@ -86,8 +83,6 @@
8683
NamedColour = wx.Colour
8784
StockCursor = wx.Cursor
8885

89-
# Moneypatch ClientDC to for rename of DrawRectangleRect to DrawRectangle
90-
ClientDC.DrawRectangleRect = ClientDC.DrawRectangle
9186
else:
9287
# define all the wxPython classic stuff
9388

0 commit comments

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