Fixed stylus line width problem.
This commit is contained in:
+7
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user