mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fix event
This commit is contained in:
parent
d3498fc0fa
commit
5e3c9f3d5d
@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## [Not released][Not released]
|
## [Not released][Not released]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- moved `globalCompositeOperation` property to `Konva.Node`
|
- moved `globalCompositeOperation` property to `Konva.Node`
|
||||||
|
|
||||||
|
12
konva.js
12
konva.js
@ -2,7 +2,7 @@
|
|||||||
* Konva JavaScript Framework v1.6.0
|
* Konva JavaScript Framework v1.6.0
|
||||||
* http://konvajs.github.io/
|
* http://konvajs.github.io/
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: Fri Apr 21 2017
|
* Date: Tue Apr 25 2017
|
||||||
*
|
*
|
||||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||||
* Modified work Copyright (C) 2014 - 2017 by Anton Lavrenov (Konva)
|
* Modified work Copyright (C) 2014 - 2017 by Anton Lavrenov (Konva)
|
||||||
@ -10436,7 +10436,7 @@
|
|||||||
this._mousewheel(evt);
|
this._mousewheel(evt);
|
||||||
},
|
},
|
||||||
_setPointerPosition: function(evt) {
|
_setPointerPosition: function(evt) {
|
||||||
var x = null, y = null;
|
var contentPosition = this._getContentPosition(), x = null, y = null;
|
||||||
evt = evt ? evt : window.event;
|
evt = evt ? evt : window.event;
|
||||||
|
|
||||||
// touch events
|
// touch events
|
||||||
@ -10445,13 +10445,13 @@
|
|||||||
if (evt.touches.length > 0) {
|
if (evt.touches.length > 0) {
|
||||||
var touch = evt.touches[0];
|
var touch = evt.touches[0];
|
||||||
// get the information for finger #1
|
// get the information for finger #1
|
||||||
x = touch.offsetX;
|
x = touch.offsetX || touch.clientX - contentPosition.left;
|
||||||
y = touch.offsetY;
|
y = touch.offsetY || touch.clientY - contentPosition.top;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// mouse events
|
// mouse events
|
||||||
x = evt.offsetX;
|
x = evt.offsetX || evt.clientX - contentPosition.left;
|
||||||
y = evt.offsetY;
|
y = evt.offsetY || evt.clientY - contentPosition.top;
|
||||||
}
|
}
|
||||||
if (x !== null && y !== null) {
|
if (x !== null && y !== null) {
|
||||||
this.pointerPos = {
|
this.pointerPos = {
|
||||||
|
8
konva.min.js
vendored
8
konva.min.js
vendored
File diff suppressed because one or more lines are too long
10
src/Stage.js
10
src/Stage.js
@ -696,7 +696,7 @@
|
|||||||
this._mousewheel(evt);
|
this._mousewheel(evt);
|
||||||
},
|
},
|
||||||
_setPointerPosition: function(evt) {
|
_setPointerPosition: function(evt) {
|
||||||
var x = null, y = null;
|
var contentPosition = this._getContentPosition(), x = null, y = null;
|
||||||
evt = evt ? evt : window.event;
|
evt = evt ? evt : window.event;
|
||||||
|
|
||||||
// touch events
|
// touch events
|
||||||
@ -705,13 +705,13 @@
|
|||||||
if (evt.touches.length > 0) {
|
if (evt.touches.length > 0) {
|
||||||
var touch = evt.touches[0];
|
var touch = evt.touches[0];
|
||||||
// get the information for finger #1
|
// get the information for finger #1
|
||||||
x = touch.offsetX;
|
x = touch.offsetX || touch.clientX - contentPosition.left;
|
||||||
y = touch.offsetY;
|
y = touch.offsetY || touch.clientY - contentPosition.top;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// mouse events
|
// mouse events
|
||||||
x = evt.offsetX;
|
x = evt.offsetX || evt.clientX - contentPosition.left;
|
||||||
y = evt.offsetY;
|
y = evt.offsetY || evt.clientY - contentPosition.top;
|
||||||
}
|
}
|
||||||
if (x !== null && y !== null) {
|
if (x !== null && y !== null) {
|
||||||
this.pointerPos = {
|
this.pointerPos = {
|
||||||
|
Loading…
Reference in New Issue
Block a user