From 40248e4828b39d46e4832ce7a425d794ecc9558f Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 3 Oct 2014 15:45:09 +0200 Subject: [PATCH] Clarify why a self.dc is needed in CanvasView.py --- CanvasView.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CanvasView.py b/CanvasView.py index e91902e..bbac60b 100755 --- a/CanvasView.py +++ b/CanvasView.py @@ -73,12 +73,10 @@ class CanvasView(wx.Window): self.Bind(wx.EVT_PAINT, self.OnPaint) - # make a DC to draw into... - self.buffer = wx.EmptyBitmap(w, h) - self.dc = wx.BufferedDC(None, self.buffer) - - # Because we want the position of the mouse pointer - # relative to the center of the canvas + # Have a reference DC with the desired coordinate system. + # Because we want the position of the mouse pointer relative to the + # center of this canvas. + self.dc = wx.MemoryDC(wx.EmptyBitmap(w, h)) self.dc.SetDeviceOrigin(w/2., h/2.) self.draw_grid = True -- 2.1.4