diff --git a/index.js b/index.js index a83ba29..795d75e 100644 --- a/index.js +++ b/index.js @@ -113,7 +113,7 @@ function atlas(options) { var data = sdf.draw(chars[i]) // ctx.putImageData(data, x + diff[0]*scale, y + diff[1]*scale, 0, -diff[1]*scale, data.width, data.height) - ctx.putImageData(data, x, y) + ctx.putImageData(data, x + diff[0]*scale, y) x += step[0] if (x > shape[0] - step[0]) { diff --git a/test.js b/test.js index 2eeec1b..ba440b6 100644 --- a/test.js +++ b/test.js @@ -10,7 +10,7 @@ let opts = { family: 'sans-serif', size: 64, // chars: [100, 120] - chars: ['●','#','✝','+', 'xyz', '▲', '▼', '_'] + chars: '◣●#◢✝+xyz▲▼_'.split('') } function update (o) { console.time('sdf')