   toJSON: ->
     {@x1, @y1, @x2, @y2, @strokeWidth, @color, @capStyle, @dash, @endCapShapes}
   fromJSON: (data) -> createShape('Line', data)
+  move: ( moveInfo={} ) ->
+    @x1 = @x1 - moveInfo.xDiff
+    @y1 = @y1 - moveInfo.yDiff
+    @x2 = @x2 - moveInfo.xDiff
+    @y2 = @y2 - moveInfo.yDiff
+  setUpperLeft: (upperLeft={}) ->
+    br = @getBoundingRect()
+    xDiff = br.x - upperLeft.x
+    yDiff = br.y - upperLeft.y
+    @move({ xDiff, yDiff })
 
 
 # returns false if no points because there are no points to share style

    }
  toJSON: -> {@x, @y, @text, @color, @font, @forcedWidth, @forcedHeight, @v}
  fromJSON: (data) -> createShape('Text', data)


defineShape 'SelectionBox',

        0, @smoothedPoints.length - @segmentSize * (@tailSize - 1)
      ).concat(@tail)

  move: ( moveInfo={} ) ->
    if !@smooth
      pts = @points
    else
      pts = @smoothedPoints

    for pt in pts
      pt.move(moveInfo)

    @points = @smoothedPoints

  setUpperLeft: (upperLeft={}) ->
    br = @getBoundingRect()
    xDiff = br.x - upperLeft.x
    yDiff = br.y - upperLeft.y
    @move({ xDiff, yDiff })

LinePath = defineShape 'LinePath', linePathFuncs

