X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1cceb75f05ead2c4c5226db236529ca98ca4db9..b4eecebd423df0c6efe86d7658cd3df818d67ed8:/wxPython/demo/DragImage.py diff --git a/wxPython/demo/DragImage.py b/wxPython/demo/DragImage.py index cb9156bd47..2592c97728 100644 --- a/wxPython/demo/DragImage.py +++ b/wxPython/demo/DragImage.py @@ -150,7 +150,7 @@ class DragCanvas(wx.ScrolledWindow): dc = evt.GetDC() if not dc: - dc = wxClientDC(self) + dc = wx.ClientDC(self) rect = self.GetUpdateRegion().GetBox() dc.SetClippingRect(rect) self.TileBackground(dc) @@ -185,10 +185,8 @@ class DragCanvas(wx.ScrolledWindow): self.dragImage.EndDrag() self.dragImage = None - dc = wx.ClientDC(self) - if self.hiliteShape: - self.hiliteShape.Draw(dc) + self.RefreshRect(self.hiliteShape.GetRect()) self.hiliteShape = None # reposition and draw the shape @@ -212,9 +210,10 @@ class DragCanvas(wx.ScrolledWindow): ) self.dragShape.shown = True - self.dragShape.Draw(dc) + self.RefreshRect(self.dragShape.GetRect()) self.dragShape = None + # The mouse is moving def OnMotion(self, evt): # Ignore mouse movement if we're not dragging.