Skip to content

Commit

Permalink
fix text shaking in some cases, fix #1211
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Sep 3, 2020
1 parent 10f12f3 commit f5b4adf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const Canvas = {
ctx.lineCap = 'round';
ctx.lineWidth = textHaloRadius * 2;
ctx.strokeStyle = textHaloFill;
ctx.strokeText(text, Math.round(pt.x), Math.round(pt.y + textOffsetY));
ctx.strokeText(text, pt.x, pt.y + textOffsetY);
ctx.miterLimit = 10; //default

ctx.globalAlpha = alpha;
Expand Down Expand Up @@ -371,7 +371,7 @@ const Canvas = {
if (rgba) {
ctx.fillStyle = rgba;
}
ctx.fillText(text, Math.round(pt.x), Math.round(pt.y + textOffsetY));
ctx.fillText(text, pt.x, pt.y + textOffsetY);
},

_stroke(ctx, strokeOpacity, x, y) {
Expand Down

0 comments on commit f5b4adf

Please sign in to comment.