 
 
   _updateCanvasGeometry: ->
-    @_updateCanvasToDocumentMatricies()
+    @_updateDocumentMatricies()
     @_layoutPropertyChanged()
     @_elementChanged()
 
-  _updateCanvasToDocumentMatricies: ->
+  _updateDocumentMatricies: ->
     {left, top} = domElementOffset @_canvas
-    documentOffset = point left, top
-    if !documentOffset.eq @_canvasDocumentOffset
-      @_canvasDocumentOffset = documentOffset
-
-      @_elementToDocumentMatrix = Matrix.translateXY left, top
+    elementToDocumentMatrix = Matrix.translateXY left, top
+
+    if !elementToDocumentMatrix.eq @_elementToDocumentMatrix
+
+      @_elementToDocumentMatrix = elementToDocumentMatrix
       @_documentToElementMatrix = @_elementToDocumentMatrix.inv
 
       @_absToDocumentMatrix = @_elementToDocumentMatrix.scale @_devicePixelsPerPoint

  #   Listen to mouseups on window, but ignore any if we didn't get a mousedown on the canvas
  _attachPointerButtonListeners: ->
    @_domListener @_canvas, "mouseover", (domEvent)=>
      @_updateCanvasToDocumentMatricies()

    @_domListener @_canvas, "mousedown", (domEvent)=>
      @_updateCanvasToDocumentMatricies()
      @_restoreFocus()
      if domEvent.button == 0
        domEvent.preventDefault()


  _attachResizeListener: ->
    @_domListener window, "resize", (domEvent)=>
      @_updateDocumentMatricies()

    @_canvas.parentElement && addResizeListener @_canvas.parentElement, @_resizeListener = =>
      @_updateCanvasGeometry()
