'makeShake' and 'updateShape' working for ellipse

This commit is contained in:
mohamed-ahmed 2013-11-19 16:59:22 +00:00
parent c8e48d9e22
commit ae8dff86a6
2 changed files with 15 additions and 8 deletions

View File

@ -26,9 +26,14 @@ define [
# @param {[type]} y the y value of the top left corner
# @param {string} colour the colour of the object
# @param {number} thickness the thickness of the object's line(s)
make: (x, y, colour, thickness) ->
make: (data) ->
x = data.shape.coordinate.firstX
y = data.shape.coordinate.firstY
color = data.shape.color
thickness = data.shape.thickness
@obj = @paper.ellipse(x * @gw + @xOffset, y * @gh + @yOffset, 0, 0)
@obj.attr Utils.strokeAndThickness(colour, thickness)
@obj.attr Utils.strokeAndThickness(color, thickness)
@definition =
shape: "ellipse"
data: [x, y, y, x, @obj.attrs["stroke"], @obj.attrs["stroke-width"]]
@ -40,11 +45,13 @@ define [
# @param {number} x2 the x value of the bottom right corner in percent of current slide size
# @param {number} y2 the y value of the bottom right corner in percent of current slide size
# @param {boolean} square (draw a circle or not
update: (x1, y1, x2, y2, circle) ->
update: (data) ->
x1 = data.shape.coordinate.firstX
y1 = data.shape.coordinate.firstY
x2 = data.shape.coordinate.lastX
y2 = data.shape.coordinate.lastY
circle = data.shape.square
if @obj?
[x1, x2] = [x2, x1] if x2 < x1

View File

@ -383,7 +383,7 @@ define [
when "rect"
@currentRect.update(data)
when "ellipse"
@currentEllipse.update.apply(@currentEllipse, data)
@currentEllipse.update(data)
when "triangle"
@currentTriangle.update.apply(@currentTriangle, data)
when "text"
@ -410,7 +410,7 @@ define [
when "ellipse"
@currentEllipse = @_createTool(shape)
toolModel = @currentEllipse
tool = @currentEllipse.make.apply(@currentEllipse, data)
tool = @currentEllipse.make(data)
when "triangle"
@currentTriangle = @_createTool(shape)
toolModel = @currentTriangle