-1

Kinetic.js 3 is not working in Firefox currently. (See bug 835064) It seems Firefox does handle mouse events differently than other browsers, but I'm not sure if there could be a simple workaround for this dragging problem, or if a web-app must be completely rewritten for Kinetic.js 4.0+ (which does work in Firefox)?

Community
  • 1
  • 1
NoBugs
  • 9,310
  • 13
  • 80
  • 146

2 Answers2

0

Haven't tested it, but you may try this.

<script src="https://local-py.googlecode.com/svn-history/r7/trunk/js/kinetic-v3.10.1.js"></script>
<script>
/* 3.10.1 */ 
//Kinetic.Stage.prototype._setMousePosition = function(evt) {
//    var mouseX = evt.offsetX || (evt.clientX - this._getContentPosition().left + window.pageXOffset);
//    var mouseY = evt.offsetY || (evt.clientY - this._getContentPosition().top + window.pageYOffset);
//    this.mousePos = {
//        x: mouseX,
//        y: mouseY
//    };
//} 
/* 4.3.1 */
Kinetic.Stage.prototype._setMousePosition = function(evt) {
   var mouseX = evt.clientX - this._getContentPosition().left;
   var mouseY = evt.clientY - this._getContentPosition().top;
   this.mousePos = {
       x: mouseX,
       y: mouseY
   };
}
</script>
allenhwkim
  • 27,270
  • 18
  • 89
  • 122
0

It seems to be a bug in Firefox's usage of Cairo in Azure canvas. This apparently always happened in Firefox 18-19 when using Cairo backend, and is fixed in Firefox 20.

NoBugs
  • 9,310
  • 13
  • 80
  • 146