Skip to content

Commit

Permalink
[Fixes tleunen#22] Add offset for stroke after checking alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepichu committed Jan 2, 2017
1 parent 662d1e6 commit 5b68a74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pixi-multistyle-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ export default class MultiStyleText extends PIXI.Text {
this.context.strokeStyle = strokeStyle;
this.context.lineWidth = textStyle.strokeThickness;

linePositionX += maxStrokeThickness / 2;
let linePositionY = (maxStrokeThickness / 2 + basePositionY) + fontProperties.ascent;

if (this._style.align === "right") {
Expand All @@ -256,6 +255,8 @@ export default class MultiStyleText extends PIXI.Text {
linePositionX += (maxLineWidth - lineWidths[i]) / 2;
}

linePositionX += maxStrokeThickness / 2;

if (textStyle.valign === "bottom") {
linePositionY += lineHeights[i] - line[j].height -
(maxStrokeThickness - textStyle.strokeThickness) / 2;
Expand Down

0 comments on commit 5b68a74

Please sign in to comment.