Added logInteractionsAbove limit

This commit is contained in:
Uwe Oestermeier 2019-05-24 09:21:02 +02:00
parent a2711a735d
commit becb749e02
3 changed files with 36 additions and 3 deletions

13
dist/iwmlib.js vendored
View File

@ -2450,9 +2450,15 @@
constructor( constructor(
element, element,
target, target,
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {} { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {}
) { ) {
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement }); super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement });
this.logInteractionsAbove = logInteractionsAbove;
}
log(message) {
let logger = (typeof app != 'undefined' && app.log) ? app : console;
logger.log(message);
} }
get targetInterface() { get targetInterface() {
@ -2474,6 +2480,11 @@
this.interaction.addTarget(key, found); this.interaction.addTarget(key, found);
} }
} }
let size = this.interaction.current.size;
let limit = this.logInteractionsAbove;
if (size > limit) {
this.log(`Number of interactions ${size} exceeds ${limit}`);
}
} }
onMouseWheel(event) { onMouseWheel(event) {

13
dist/iwmlib.pixi.js vendored
View File

@ -5614,9 +5614,15 @@
constructor( constructor(
element, element,
target, target,
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {} { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {}
) { ) {
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement }); super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement });
this.logInteractionsAbove = logInteractionsAbove;
}
log(message) {
let logger = (typeof app != 'undefined' && app.log) ? app : console;
logger.log(message);
} }
get targetInterface() { get targetInterface() {
@ -5638,6 +5644,11 @@
this.interaction.addTarget(key, found); this.interaction.addTarget(key, found);
} }
} }
let size = this.interaction.current.size;
let limit = this.logInteractionsAbove;
if (size > limit) {
this.log(`Number of interactions ${size} exceeds ${limit}`);
}
} }
onMouseWheel(event) { onMouseWheel(event) {

View File

@ -910,9 +910,15 @@ export class InteractionMapper extends InteractionDelegate {
constructor( constructor(
element, element,
target, target,
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {} { tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {}
) { ) {
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement }) super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement })
this.logInteractionsAbove = logInteractionsAbove
}
log(message) {
let logger = (typeof app != 'undefined' && app.log) ? app : console
logger.log(message)
} }
get targetInterface() { get targetInterface() {
@ -934,6 +940,11 @@ export class InteractionMapper extends InteractionDelegate {
this.interaction.addTarget(key, found) this.interaction.addTarget(key, found)
} }
} }
let size = this.interaction.current.size
let limit = this.logInteractionsAbove
if (size > limit) {
this.log(`Number of interactions ${size} exceeds ${limit}`)
}
} }
onMouseWheel(event) { onMouseWheel(event) {