mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
update CHANGELOG with new version
This commit is contained in:
15
src/Stage.ts
15
src/Stage.ts
@@ -764,6 +764,9 @@ export class Stage extends Container<BaseLayer> {
|
||||
|
||||
var triggeredOnShape = false;
|
||||
var processedShapesIds = {};
|
||||
var tapTriggered = false;
|
||||
var dblTapTriggered = false;
|
||||
|
||||
this._changedPointerPositions.forEach(pos => {
|
||||
var shape =
|
||||
(PointerEvents.getCapturedShape(pos.id) as Shape) ||
|
||||
@@ -787,14 +790,12 @@ export class Stage extends Container<BaseLayer> {
|
||||
triggeredOnShape = true;
|
||||
|
||||
// detect if tap or double tap occurred
|
||||
if (
|
||||
Konva.listenClickTap &&
|
||||
this.tapStartShape &&
|
||||
shape._id === this.tapStartShape._id
|
||||
) {
|
||||
if (Konva.listenClickTap && shape === this.tapStartShape) {
|
||||
tapTriggered = true;
|
||||
shape._fireAndBubble(TAP, { evt: evt, pointerId: pos.id });
|
||||
|
||||
if (fireDblClick && clickEndShape && clickEndShape === shape) {
|
||||
dblTapTriggered = true;
|
||||
shape._fireAndBubble(DBL_TAP, { evt: evt, pointerId: pos.id });
|
||||
}
|
||||
}
|
||||
@@ -814,7 +815,7 @@ export class Stage extends Container<BaseLayer> {
|
||||
});
|
||||
}
|
||||
|
||||
if (Konva.listenClickTap) {
|
||||
if (Konva.listenClickTap && !tapTriggered) {
|
||||
this._fire(TAP, {
|
||||
evt: evt,
|
||||
target: this,
|
||||
@@ -822,7 +823,7 @@ export class Stage extends Container<BaseLayer> {
|
||||
pointerId: this._changedPointerPositions[0].id
|
||||
});
|
||||
}
|
||||
if (fireDblClick) {
|
||||
if (fireDblClick && !dblTapTriggered) {
|
||||
this._fire(DBL_TAP, {
|
||||
evt: evt,
|
||||
target: this,
|
||||
|
@@ -35,7 +35,7 @@ export class Collection<Child extends Node> {
|
||||
// @ts-ignore
|
||||
each: (f: (child: Child, index: number) => void) => void;
|
||||
// @ts-ignore
|
||||
toArray: () => Array<any>;
|
||||
toArray: () => Array<Child>;
|
||||
// @ts-ignore
|
||||
push: (item: Child) => void;
|
||||
// @ts-ignore
|
||||
@@ -767,12 +767,12 @@ export const Util = {
|
||||
// Check hsl() format
|
||||
if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(str)) {
|
||||
// Extract h, s, l
|
||||
const [_, ...hsl]= /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str);
|
||||
const [_, ...hsl] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str);
|
||||
|
||||
const h = Number(hsl[0]) / 360;
|
||||
const s = Number(hsl[1]) / 100;
|
||||
const l = Number(hsl[2]) / 100;
|
||||
|
||||
|
||||
let t2;
|
||||
let t3;
|
||||
let val;
|
||||
@@ -797,7 +797,7 @@ export const Util = {
|
||||
|
||||
const rgb = [0, 0, 0];
|
||||
for (let i = 0; i < 3; i++) {
|
||||
t3 = h + 1 / 3 * -(i - 1);
|
||||
t3 = h + (1 / 3) * -(i - 1);
|
||||
if (t3 < 0) {
|
||||
t3++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user