diff --git a/demos/customization/index.html b/demos/customization/index.html
index ee18f70f..b7eb5163 100644
--- a/demos/customization/index.html
+++ b/demos/customization/index.html
@@ -37,6 +37,11 @@
No object boundaries + opacity on move
+
+
+
Custom cursor on object hover
+
+
Unselectable canvas
@@ -118,6 +123,10 @@
}
});
+ var canvas11 = new fabric.Canvas('c11');
+ canvas11.add(new fabric.Circle({ radius: 30, fill: '#f55', top: 100, left: 100 }));
+ canvas11.HOVER_CURSOR = 'pointer';
+
var canvas4 = new fabric.Canvas('c4');
canvas4.add(new fabric.Circle({ radius: 30, fill: '#f55', top: 100, left: 100 }));
canvas4.add(new fabric.Rect({ left: 50, top: 50, fill: 'green', width: 30, height: 30 }));
diff --git a/dist/all.js b/dist/all.js
index 0dbe4da6..5cc86a33 100644
--- a/dist/all.js
+++ b/dist/all.js
@@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
-var fabric = fabric || { version: "0.3.1" };
+var fabric = fabric || { version: "0.3.2" };
/**
* Wrapper around `console.log` (when available)
@@ -4089,6 +4089,12 @@ fabric.util.animate = animate;
*/
CONTAINER_CLASS: 'canvas-container',
+ /**
+ * @constant
+ * @type String
+ */
+ HOVER_CURSOR: 'move',
+
/**
* Callback; invoked right before object is about to be scaled/rotated
* @method onBeforeScaleRotate
@@ -4860,7 +4866,7 @@ fabric.util.animate = animate;
&& target._findTargetCorner(e, this._offset);
if (!corner) {
- s.cursor = 'move';
+ s.cursor = this.HOVER_CURSOR;
}
else {
if (corner in cursorMap) {
diff --git a/fabric.js b/fabric.js
index dc443e33..0f54cfeb 100644
--- a/fabric.js
+++ b/fabric.js
@@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
-var fabric = fabric || { version: "0.3.1" };
+var fabric = fabric || { version: "0.3.2" };
/**
* Wrapper around `console.log` (when available)
diff --git a/src/canvas.class.js b/src/canvas.class.js
index a0c1047f..c9173cf0 100644
--- a/src/canvas.class.js
+++ b/src/canvas.class.js
@@ -215,6 +215,12 @@
*/
CONTAINER_CLASS: 'canvas-container',
+ /**
+ * @constant
+ * @type String
+ */
+ HOVER_CURSOR: 'move',
+
/**
* Callback; invoked right before object is about to be scaled/rotated
* @method onBeforeScaleRotate
@@ -1022,7 +1028,7 @@
&& target._findTargetCorner(e, this._offset);
if (!corner) {
- s.cursor = 'move';
+ s.cursor = this.HOVER_CURSOR;
}
else {
if (corner in cursorMap) {