[BACK_INCOMPAT] Remove CANVAS_WIDTH, CANVAS_HEIGHT properties from fabric.Canvas.prototype (as they're no longer used anywhere). Lowercase some of the fabric.Canvas.prototype properties, for consistency: CURSOR -> defaultCursor, ROTATION_CURSOR -> rotationCursor, HOVER_CURSOR -> hoverCursor, CONTAINER_CLASS -> containerClass.

This commit is contained in:
kangax 2012-06-23 00:18:33 +02:00
parent 9d36e26d71
commit 9926d8389a
7 changed files with 35 additions and 63 deletions

View file

@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2012, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "0.8.22" };
var fabric = fabric || { version: "0.8.23" };
if (typeof exports != 'undefined') {
exports.fabric = fabric;

46
dist/all.js vendored
View file

@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2012, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "0.8.22" };
var fabric = fabric || { version: "0.8.23" };
if (typeof exports != 'undefined') {
exports.fabric = fabric;
@ -4747,20 +4747,6 @@ fabric.util.string = {
*/
clipTo: null,
/**
* Default canvas width
* @constant
* @type Number
*/
CANVAS_WIDTH: 600,
/**
* Default canvas height
* @constant
* @type Number
*/
CANVAS_HEIGHT: 600,
/**
* Callback; invoked right before object is about to be scaled/rotated
* @method onBeforeScaleRotate
@ -5792,31 +5778,31 @@ fabric.util.string = {
/**
* Default cursor value used when hovering over an object on canvas
* @constant
* @property
* @type String
*/
HOVER_CURSOR: 'move',
hoverCursor: 'move',
/**
* Default cursor value used for the entire canvas
* @constant
* @property
* @type String
*/
CURSOR: 'default',
defaultCursor: 'default',
/**
* Cursor value used for rotation point
* @constant
* @property
* @type String
*/
ROTATION_CURSOR: 'crosshair',
rotationCursor: 'crosshair',
/**
* Default element class that's given to wrapper (div) element of canvas
* @constant
* @property
* @type String
*/
CONTAINER_CLASS: 'canvas-container',
containerClass: 'canvas-container',
_initInteractive: function() {
this._currentTransform = null;
@ -5934,7 +5920,7 @@ fabric.util.string = {
if (activeGroup) {
activeGroup.setObjectsCoords();
activeGroup.set('isMoving', false);
this._setCursor(this.CURSOR);
this._setCursor(this.defaultCursor);
}
// clear selection
@ -6073,7 +6059,7 @@ fabric.util.string = {
this._objects[i].setActive(false);
}
}
style.cursor = this.CURSOR;
style.cursor = this.defaultCursor;
}
else {
// set proper cursor
@ -6466,7 +6452,7 @@ fabric.util.string = {
_setCursorFromEvent: function (e, target) {
var s = this.upperCanvasEl.style;
if (!target) {
s.cursor = this.CURSOR;
s.cursor = this.defaultCursor;
return false;
}
else {
@ -6477,15 +6463,15 @@ fabric.util.string = {
&& target._findTargetCorner(e, this._offset);
if (!corner) {
s.cursor = this.HOVER_CURSOR;
s.cursor = this.hoverCursor;
}
else {
if (corner in cursorMap) {
s.cursor = cursorMap[corner];
} else if (corner === 'mtr' || corner === 'mbr') {
s.cursor = this.ROTATION_CURSOR
s.cursor = this.rotationCursor;
} else {
s.cursor = this.CURSOR;
s.cursor = this.defaulCursor;
return false;
}
}
@ -6633,7 +6619,7 @@ fabric.util.string = {
*/
_initWrapperElement: function () {
this.wrapperEl = fabric.util.wrapElement(this.lowerCanvasEl, 'div', {
'class': this.CONTAINER_CLASS
'class': this.containerClass
});
fabric.util.setStyle(this.wrapperEl, {
width: this.getWidth() + 'px',

4
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -1,7 +1,7 @@
{
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"version": "0.8.22",
"version": "0.8.23",
"author": "Juriy Zaytsev <kangax@gmail.com>",
"keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"],
"repository": "git://github.com/kangax/fabric.js",

View file

@ -100,31 +100,31 @@
/**
* Default cursor value used when hovering over an object on canvas
* @constant
* @property
* @type String
*/
HOVER_CURSOR: 'move',
hoverCursor: 'move',
/**
* Default cursor value used for the entire canvas
* @constant
* @property
* @type String
*/
CURSOR: 'default',
defaultCursor: 'default',
/**
* Cursor value used for rotation point
* @constant
* @property
* @type String
*/
ROTATION_CURSOR: 'crosshair',
rotationCursor: 'crosshair',
/**
* Default element class that's given to wrapper (div) element of canvas
* @constant
* @property
* @type String
*/
CONTAINER_CLASS: 'canvas-container',
containerClass: 'canvas-container',
_initInteractive: function() {
this._currentTransform = null;
@ -242,7 +242,7 @@
if (activeGroup) {
activeGroup.setObjectsCoords();
activeGroup.set('isMoving', false);
this._setCursor(this.CURSOR);
this._setCursor(this.defaultCursor);
}
// clear selection
@ -381,7 +381,7 @@
this._objects[i].setActive(false);
}
}
style.cursor = this.CURSOR;
style.cursor = this.defaultCursor;
}
else {
// set proper cursor
@ -774,7 +774,7 @@
_setCursorFromEvent: function (e, target) {
var s = this.upperCanvasEl.style;
if (!target) {
s.cursor = this.CURSOR;
s.cursor = this.defaultCursor;
return false;
}
else {
@ -785,15 +785,15 @@
&& target._findTargetCorner(e, this._offset);
if (!corner) {
s.cursor = this.HOVER_CURSOR;
s.cursor = this.hoverCursor;
}
else {
if (corner in cursorMap) {
s.cursor = cursorMap[corner];
} else if (corner === 'mtr' || corner === 'mbr') {
s.cursor = this.ROTATION_CURSOR
s.cursor = this.rotationCursor;
} else {
s.cursor = this.CURSOR;
s.cursor = this.defaulCursor;
return false;
}
}
@ -941,7 +941,7 @@
*/
_initWrapperElement: function () {
this.wrapperEl = fabric.util.wrapElement(this.lowerCanvasEl, 'div', {
'class': this.CONTAINER_CLASS
'class': this.containerClass
});
fabric.util.setStyle(this.wrapperEl, {
width: this.getWidth() + 'px',

View file

@ -91,20 +91,6 @@
*/
clipTo: null,
/**
* Default canvas width
* @constant
* @type Number
*/
CANVAS_WIDTH: 600,
/**
* Default canvas height
* @constant
* @type Number
*/
CANVAS_HEIGHT: 600,
/**
* Callback; invoked right before object is about to be scaled/rotated
* @method onBeforeScaleRotate