def draw(self, canvas): x, y = canvas.pos_to_pixel(self.x, self.y) if self.valid: canvas.dc.SetPen(wx.Pen(self.dark_color, 2, wx.DOT)) else: canvas.dc.SetPen(wx.Pen(wx.Colour(255, 0, 0), 2, wx.DOT)) canvas.dc.DrawLine(x-200, y, x+200, y) Transform.draw(self, canvas)
def draw(self, canvas): dy = self.amount.y - self.y dx = self.amount.x - self.x if self.valid: canvas.dc.SetPen(wx.Pen(self.dark_color, 2, wx.DOT)) else: canvas.dc.SetPen(wx.Pen(wx.Colour(255, 0, 0), 2, wx.DOT)) x0, y0 = canvas.pos_to_pixel(self.x, self.y - dy) x1, y1 = canvas.pos_to_pixel(self.x, self.y + dy) offset = canvas.pos_to_pixel(dx) canvas.dc.DrawLine(x0, y0, x1, y1) canvas.dc.DrawLine(x0, y0, x0-offset, y0) canvas.dc.DrawLine(x1, y1, x1+offset, y1) canvas.dc.DrawLine(x0-offset, y0, x1+offset, y1) Transform.draw(self, canvas)