--- a/graphics/GraphicCommons.py Mon Nov 07 10:55:17 2011 +0100
+++ b/graphics/GraphicCommons.py Tue Nov 08 21:59:22 2011 +0100
@@ -393,8 +393,9 @@
class RubberBand:
# Create a rubberband by indicated on which window it must be drawn
- def __init__(self, drawingSurface):
- self.drawingSurface = drawingSurface
+ def __init__(self, viewer):
+ self.Viewer = viewer
+ self.drawingSurface = viewer.Editor
self.Reset()
# Method that initializes the internal attributes of the rubberband
@@ -451,7 +452,7 @@
# Method that erase the last box and draw the new box
def Redraw(self, dc = None):
if not dc:
- dc = self.drawingSurface.GetLogicalDC()
+ dc = self.Viewer.GetLogicalDC()
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
dc.SetPen(wx.Pen(wx.WHITE, 1, wx.DOT))
@@ -470,7 +471,7 @@
# Erase last box
def Erase(self, dc = None):
if not dc:
- dc = self.drawingSurface.GetLogicalDC()
+ dc = self.Viewer.GetLogicalDC()
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
dc.SetPen(wx.Pen(wx.WHITE, 1, wx.DOT))
@@ -484,7 +485,7 @@
# Draw current box
def Draw(self, dc = None):
if not dc:
- dc = self.drawingSurface.GetLogicalDC()
+ dc = self.Viewer.GetLogicalDC()
scalex, scaley = dc.GetUserScale()
dc.SetUserScale(1, 1)
dc.SetPen(wx.Pen(wx.WHITE, 1, wx.DOT))