1 var Ellipse, ToolWithStroke, createShape,
2 extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
3 hasProp = {}.hasOwnProperty;
5 ToolWithStroke = require('./base').ToolWithStroke;
7 createShape = require('../core/shapes').createShape;
9 module.exports = Ellipse = (function(superClass) {
10 extend(Ellipse, superClass);
13 return Ellipse.__super__.constructor.apply(this, arguments);
16 Ellipse.prototype.name = 'Ellipse';
18 Ellipse.prototype.iconName = 'ellipse';
20 Ellipse.prototype.begin = function(x, y, lc) {
21 return this.currentShape = createShape('Ellipse', {
24 strokeWidth: this.strokeWidth,
25 strokeColor: lc.getColor('primary'),
26 fillColor: lc.getColor('secondary')
30 Ellipse.prototype["continue"] = function(x, y, lc) {
31 this.currentShape.width = x - this.currentShape.x;
32 this.currentShape.height = y - this.currentShape.y;
33 return lc.drawShapeInProgress(this.currentShape);
36 Ellipse.prototype.end = function(x, y, lc) {
37 return lc.saveShape(this.currentShape);