This commit is contained in:
Tim de Koning
2019-08-22 16:40:05 +02:00
parent 9e7aee0f17
commit 26e18366f4
3 changed files with 16307 additions and 16299 deletions

View File

@@ -8,7 +8,7 @@
* Konva JavaScript Framework v4.0.5
* http://konvajs.org/
* Licensed under the MIT
* Date: Sat Aug 17 2019
* Date: Thu Aug 22 2019
*
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
@@ -5819,12 +5819,13 @@
* get pointer position which can be a touch position or mouse position
* @method
* @name Konva.Stage#getPointerPosition
* @returns {Object}
* @returns {Vector2d|null}
*/
Stage.prototype.getPointerPosition = function () {
var pos = this._pointerPositions[0];
if (!pos) {
Util.warn(NO_POINTERS_MESSAGE);
return null;
}
return {
x: pos.x,
@@ -5878,6 +5879,9 @@
* var group = stage.getIntersection({x: 50, y: 50}, 'Group');
*/
Stage.prototype.getIntersection = function (pos, selector) {
if (!pos) {
return null;
}
var layers = this.children, len = layers.length, end = len - 1, n, shape;
for (n = end; n >= 0; n--) {
shape = layers[n].getIntersection(pos, selector);
@@ -5939,7 +5943,7 @@
setPointerCapture(pointerId, this);
};
Stage.prototype.releaseCapture = function (pointerId) {
releaseCapture(pointerId, this);
releaseCapture(pointerId);
};
/**
* returns a {@link Konva.Collection} of layers
@@ -7426,7 +7430,7 @@
setPointerCapture(pointerId, this);
};
Shape.prototype.releaseCapture = function (pointerId) {
releaseCapture(pointerId, this);
releaseCapture(pointerId);
};
return Shape;
}(Node));

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -244,12 +244,13 @@ export class Stage extends Container<BaseLayer> {
* get pointer position which can be a touch position or mouse position
* @method
* @name Konva.Stage#getPointerPosition
* @returns {Object}
* @returns {Vector2d|null}
*/
getPointerPosition() {
getPointerPosition(): Vector2d | null {
const pos = this._pointerPositions[0];
if (!pos) {
Util.warn(NO_POINTERS_MESSAGE);
return null;
}
return {
x: pos.x,
@@ -316,7 +317,10 @@ export class Stage extends Container<BaseLayer> {
* // or if you interested in shape parent:
* var group = stage.getIntersection({x: 50, y: 50}, 'Group');
*/
getIntersection(pos: Vector2d, selector?: string): Shape | null {
getIntersection(pos: Vector2d | null, selector?: string): Shape | null {
if (!pos) {
return null;
}
var layers = this.children,
len = layers.length,
end = len - 1,