1

Get rid of fabric.js, use raphael

This commit is contained in:
Alex Yatskov 2014-10-30 19:20:46 +09:00
parent e51949313b
commit 7c03663e75
2 changed files with 30 additions and 30 deletions

View File

@ -14,11 +14,11 @@
],
"dependencies": {
"bootstrap": "~3.2.0",
"fabric": "~1.4.8",
"handlebars": "~1.3.0",
"underscore": "~1.6.0",
"bootstrap-select": "~1.6.2",
"tinycolor": "~1.0.0",
"seiyria-bootstrap-slider": "~4.0.1"
"seiyria-bootstrap-slider": "~4.0.1",
"raphael": "~2.1.2"
}
}

View File

@ -191,39 +191,39 @@
};
this.updateRect = function(name, args) {
if (name in this) {
this[name].set(args);
}
else {
var rect = new fabric.Rect(args);
this.canvas.add(rect);
this.shapes.push(rect);
this[name] = rect;
}
// if (name in this) {
// this[name].set(args);
// }
// else {
// var rect = new fabric.Rect(args);
// this.canvas.add(rect);
// this.shapes.push(rect);
// this[name] = rect;
// }
};
this.updateText = function(name, str, args) {
if (name in this) {
this[name].set(args);
}
else {
var text = new fabric.Text(str, args);
this.canvas.add(text);
this.shapes.push(text);
this[name] = text;
}
// if (name in this) {
// this[name].set(args);
// }
// else {
// var text = new fabric.Text(str, args);
// this.canvas.add(text);
// this.shapes.push(text);
// this[name] = text;
// }
};
this.updateLine = function(name, points, args) {
if (name in this) {
this[name].set(args);
}
else {
var line = new fabric.Line(points, args);
this.canvas.add(line);
this.shapes.push(line);
this[name] = line;
}
// if (name in this) {
// this[name].set(args);
// }
// else {
// var line = new fabric.Line(points, args);
// this.canvas.add(line);
// this.shapes.push(line);
// this[name] = line;
// }
};
this.decimateHints = function(steps, scale) {
@ -679,7 +679,7 @@
this.useLocalScale = useLocalScale;
this.useRelativeScale = useRelativeScale;
this.columnWidth = columnWidth;
this.canvas = new fabric.StaticCanvas(canvas);
this.canvas = null;
this.range = new Range(range.min, range.max);
this.padding = 10;
this.indexMap = {};