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

Revert "WX Monkey patch ClientDC for name changes" #4594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "WX Monkey patch ClientDC for name changes"
This doesn't actually work correctly and missed patching GCDC

This reverts commit 752d738.
  • Loading branch information
jenshnielsen committed Jul 6, 2015
commit 60faeb68d564c8c4da3e47057d81851c34e4c9a4
9 changes: 6 additions & 3 deletions 9 lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def gui_repaint(self, drawDC=None, origin='WX'):
if self.IsShownOnScreen():
if not drawDC:
# not called from OnPaint use a ClientDC
drawDC = wxc.ClientDC(self)
drawDC = wx.ClientDC(self)

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

dc = wxc.ClientDC(self.canvas)
dc = wx.ClientDC(self.canvas)
odc = wx.DCOverlay(self.wxoverlay, dc)
odc.Clear()

Expand Down Expand Up @@ -1721,7 +1721,10 @@ def draw_rubberband(self, event, x0, y0, x1, y1):
r, g, b, a = color.Get(True)
color.Set(r, g, b, 0x60)
dc.SetBrush(wx.Brush(color))
dc.DrawRectangleRect(rect)
if wxc.is_phoenix:
dc.DrawRectangle(rect)
else:
dc.DrawRectangleRect(rect)

def set_status_bar(self, statbar):
self.statbar = statbar
Expand Down
5 changes: 0 additions & 5 deletions 5 lib/matplotlib/backends/wx_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
print(" wxPython version %s was imported." % backend_version)
raise ImportError(missingwx)

# Import ClientCD so we can Monkey patch it.
ClientDC = wx.ClientDC

if is_phoenix:
# define all the wxPython phoenix stuff

Expand Down Expand Up @@ -86,8 +83,6 @@
NamedColour = wx.Colour
StockCursor = wx.Cursor

# Moneypatch ClientDC to for rename of DrawRectangleRect to DrawRectangle
ClientDC.DrawRectangleRect = ClientDC.DrawRectangle
else:
# define all the wxPython classic stuff

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.