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": { "dependencies": {
"bootstrap": "~3.2.0", "bootstrap": "~3.2.0",
"fabric": "~1.4.8",
"handlebars": "~1.3.0", "handlebars": "~1.3.0",
"underscore": "~1.6.0", "underscore": "~1.6.0",
"bootstrap-select": "~1.6.2", "bootstrap-select": "~1.6.2",
"tinycolor": "~1.0.0", "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) { this.updateRect = function(name, args) {
if (name in this) { // if (name in this) {
this[name].set(args); // this[name].set(args);
} // }
else { // else {
var rect = new fabric.Rect(args); // var rect = new fabric.Rect(args);
this.canvas.add(rect); // this.canvas.add(rect);
this.shapes.push(rect); // this.shapes.push(rect);
this[name] = rect; // this[name] = rect;
} // }
}; };
this.updateText = function(name, str, args) { this.updateText = function(name, str, args) {
if (name in this) { // if (name in this) {
this[name].set(args); // this[name].set(args);
} // }
else { // else {
var text = new fabric.Text(str, args); // var text = new fabric.Text(str, args);
this.canvas.add(text); // this.canvas.add(text);
this.shapes.push(text); // this.shapes.push(text);
this[name] = text; // this[name] = text;
} // }
}; };
this.updateLine = function(name, points, args) { this.updateLine = function(name, points, args) {
if (name in this) { // if (name in this) {
this[name].set(args); // this[name].set(args);
} // }
else { // else {
var line = new fabric.Line(points, args); // var line = new fabric.Line(points, args);
this.canvas.add(line); // this.canvas.add(line);
this.shapes.push(line); // this.shapes.push(line);
this[name] = line; // this[name] = line;
} // }
}; };
this.decimateHints = function(steps, scale) { this.decimateHints = function(steps, scale) {
@ -679,7 +679,7 @@
this.useLocalScale = useLocalScale; this.useLocalScale = useLocalScale;
this.useRelativeScale = useRelativeScale; this.useRelativeScale = useRelativeScale;
this.columnWidth = columnWidth; this.columnWidth = columnWidth;
this.canvas = new fabric.StaticCanvas(canvas); this.canvas = null;
this.range = new Range(range.min, range.max); this.range = new Range(range.min, range.max);
this.padding = 10; this.padding = 10;
this.indexMap = {}; this.indexMap = {};