littlejsengine 1.18.25 → 1.18.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/littlejs.esm.js +619 -613
- package/dist/littlejs.esm.min.js +1 -1
- package/dist/littlejs.js +619 -613
- package/dist/littlejs.min.js +1 -1
- package/dist/littlejs.release.js +619 -613
- package/package.json +58 -58
- package/src/engine.js +612 -612
- package/src/engineDraw.js +9 -3
package/src/engineDraw.js
CHANGED
|
@@ -1463,9 +1463,15 @@ class ImageFont
|
|
|
1463
1463
|
tileInfo.pos.x = x*sizePaddedX + padding;
|
|
1464
1464
|
tileInfo.pos.y = y*sizePaddedY + padding;
|
|
1465
1465
|
|
|
1466
|
-
//
|
|
1467
|
-
|
|
1468
|
-
|
|
1466
|
+
// snap the glyph edges to whole pixels
|
|
1467
|
+
// tiles are drawn from their center, so snapping the center
|
|
1468
|
+
// to a whole pixel puts the edges on half pixels when the
|
|
1469
|
+
// size is even, and a row or column of the glyph then has
|
|
1470
|
+
// no pixel center inside it and is not rasterized at all
|
|
1471
|
+
// ceil picks the nearest aligned position, breaking ties
|
|
1472
|
+
// downward to match how this used to truncate
|
|
1473
|
+
drawPos.x = ceil(pos.x + i * size.x - centerOffset - size.x/2) + size.x/2 - .5;
|
|
1474
|
+
drawPos.y = ceil(pos.y + j * size.y - size.y/2) + size.y/2 - .5;
|
|
1469
1475
|
drawTile(drawPos, size, tileInfo, color, 0, false, undefined, useWebGL, true, context);
|
|
1470
1476
|
}
|
|
1471
1477
|
});
|