def InitBuffer(self):
"""Initialize the bitmap used for buffering the display."""
size = self.GetClientSize()
- self.buffer = wx.EmptyBitmap(size.width, size.height)
+ self.buffer = wx.EmptyBitmap(max(1,size.width), max(1,size.height))
dc = wx.BufferedDC(None, self.buffer)
dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
dc.Clear()
dc.BeginDrawing()
dc.SetPen(self.pen)
pos = event.GetPosition()
- coords = (self.pos, pos)
+ coords = (self.pos.x, self.pos.y, pos.x, pos.y)
self.curLine.append(coords)
dc.DrawLine(*coords)
self.pos = pos