Fixed stylus line width problem.

This commit is contained in:
2019-09-18 16:43:01 +02:00
parent 71e5ce8b8e
commit 0e5be56dfe
3 changed files with 30 additions and 3 deletions
+8 -2
View File
@@ -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();