diff --git a/dist/iwmlib.js b/dist/iwmlib.js index 6348c2b..12cfc9c 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -10965,6 +10965,21 @@ } speak() { + /** + * This is a little bit ugly, but imho the most elegant of all dirty solutions. + * + 5ht * Within the plugins we have no knowledge of other cards and such. But must differentiate the + * clicks by their corresponding owner. The SpeechUtterance just takes a text and has no knowledge + * about the node that is currently read to the user. + * + * This means, that we can identify same text, but not differentiate same text on different nodes. + * To account for that, we add the node to the speechSynthesis object (#benefitsOfJavaScript) and + * have access to the node, by - let's say - expanding the functionality of the SpeechSynthesis object. + * + * SO -17.07.19 + */ + + let activeNode = window.speechSynthesis['speechPluginNode']; this._updateText(); } diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 8cd7bd8..97faea3 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -14604,7 +14604,7 @@ } tiltToLineWidth(value) { - return Math.round(Math.abs(value / 10) + 1) + return 16 // Math.round(Math.abs(value / 10) + 1) } drawStroke(stroke) { @@ -14612,9 +14612,15 @@ let start = stroke[0]; this.beginFill(0, 0); this.moveTo(start.x, start.y); + let lineWidth = this.tiltToLineWidth(start.tiltY); + this.lineStyle(lineWidth, start.color, this.colorAlpha); for (let i = 1; i < stroke.length; i++) { let info = stroke[i]; - this.lineStyle(this.tiltToLineWidth(info.tiltY), info.color, this.colorAlpha); + let lw = this.tiltToLineWidth(info.tiltY); + if (lw != lineWidth) { + lineWidth = lw; + this.lineStyle(lineWidth, info.color, this.colorAlpha); + } this.lineTo(info.x, info.y); } this.endFill(); diff --git a/lib/pixi/stylus.js b/lib/pixi/stylus.js index 7a5c118..62b0693 100755 --- a/lib/pixi/stylus.js +++ b/lib/pixi/stylus.js @@ -305,9 +305,15 @@ export default class Stylus extends PIXI.Graphics { let start = stroke[0] this.beginFill(0, 0) this.moveTo(start.x, start.y) + let lineWidth = this.tiltToLineWidth(start.tiltY) + this.lineStyle(lineWidth, start.color, this.colorAlpha) for (let i = 1; i < stroke.length; i++) { let info = stroke[i] - this.lineStyle(this.tiltToLineWidth(info.tiltY), info.color, this.colorAlpha) + let lw = this.tiltToLineWidth(info.tiltY) + if (lw != lineWidth) { + lineWidth = lw + this.lineStyle(lineWidth, info.color, this.colorAlpha) + } this.lineTo(info.x, info.y) } this.endFill()