title: Python Tkinter continuous line with endpoints that don't match up
body: <p>Basically I'm trying to create a continuous line (starting when the user clicks, ending when they right click), and I have it working, but for some reason the end points (ovals), don't really line up perfectly with the sides of the line (it becomes really obvious when you try drawing a straight line with multiple points or try right angles)... i've tried just about everything and am thoroughly frustrated so I posted here to see if you guys had any ideas..</p>
  
  <p>Here's the code so you can try it out and see what i mean:</p>
  
  <pre><code>from Tkinter import *
  
  class GUI:
      def __init__(self,root):
          Window = Frame(root)
          self.DrawArea = Canvas(Window)
          self.DrawArea.pack()
          Window.pack()
  
          self.linewidth = 20
  
          self.DrawArea.config(cursor="crosshair")
          self.DrawArea.bind("&lt;Button 1&gt;",self.startline)
  
  
      def startline(self,event):
          self.startx, self.starty = self.DrawArea.canvasx(event.x),self.DrawArea.canvasy(event.y)
  
          xa,ya = self.startx-self.linewidth/2 , self.starty+self.linewidth/2
          xb,yb = self.startx+self.linewidth/2 , self.starty-self.linewidth/2
  
          self.StartPoint = self.DrawArea.create_oval(xa,ya,xb,yb,fill='red',outline='')
          self.Line = None
          self.EndPoint = None
  
          self.DrawArea.bind("&lt;Motion&gt;",self.updateline)
          self.DrawArea.bind("&lt;Button 3&gt;",self.killline)
  
      def updateline(self,event):
          if self.EndPoint: self.DrawArea.delete(self.EndPoint)
          if self.Line: self.DrawArea.delete(self.Line)
  
          x,y = self.DrawArea.canvasx(event.x),self.DrawArea.canvasy(event.y)
          xa,ya = x-self.linewidth/2 , y+self.linewidth/2
          xb,yb = x+self.linewidth/2 , y-self.linewidth/2
  
          self.Line = self.DrawArea.create_line(self.startx,self.starty,x,y,fill='red',width=self.linewidth)
          self.EndPoint = self.DrawArea.create_oval(xa,ya,xb,yb,fill='red',outline='')
  
      def killline(self,event):
          self.DrawArea.delete(self.Line)
          self.DrawArea.delete(self.StartPoint)
          self.DrawArea.delete(self.EndPoint)
          self.DrawArea.unbind("&lt;Motion&gt;")
  
  
  if __name__ == '__main__':
      root = Tk()
      root.title("Line Draw")
      App = GUI(root)
      root.mainloop()
  </code></pre>