Commit 1018986f by doszhang

dos

parent ea85bf7b
...@@ -854,14 +854,14 @@ function pxToRem(px) { ...@@ -854,14 +854,14 @@ function pxToRem(px) {
} }
function flagNoDraw(ctx, content, fontsize, fontweight, color, x, y) { function flagNoDraw(ctx, content, fontsize, fontweight, color, x, y) {
x = x * 2; // x = x * 2;
y = y * 2; // y = y * 2;
fontsize = fontsize * 2; fontsize = fontsize * 2;
ctx.font = fontweight + ' ' + fontsize + 'px'; ctx.font = fontweight + ' ' + fontsize + 'px';
var width = ctx.measureText(content).width; var width = ctx.measureText(content).width;
var cx = x - width / 2; var cx = x - width / 2;
ctx.fillStyle = color; ctx.fillStyle = color;
ctx.fillText(content, x, y); ctx.fillText(content, cx, y);
} }
function calculateStringLength(str) { function calculateStringLength(str) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment