 
   # need some work
   _adjustPositionAfterZoom: (newZoom) ->
-    @position.x = @position.x*newZoom/@zoom + @canvas.width*(@zoom/newZoom-1)/2
-    @position.y = @position.y*newZoom/@zoom + @canvas.height*(@zoom/newZoom-1)/2
+    width = @canvas.width
+    height = @canvas.height
+    @position.x += ((@zoom * width) - (newZoom * width)) / 2;
+    @position.y += ((@zoom * height) - (newZoom * height)) / 2;
 
   translate: () ->
     {

class fabric.Viewport
  constructor: (canvas) -> 
    @i = 0
    @position = new fabric.Point(0,0)
    @zoom = 1

      pageY: e.pageY - @translate().y,
      screenX: e.screenX - @translate().x,
      screenY: e.screenY - @translate().y
    }
