diff --git a/package-lock.json b/package-lock.json index b73c3db..25ab797 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,12 +26,11 @@ "tiny-inflate": "^1.0.3", "unicode-properties": "^1.4.0", "unicode-trie": "^2.0.0", - "x11": "^4.1.0", - "x11-dri": "0.9.1" + "x11": "^4.1.0" }, "devDependencies": { "@conventional-commits/parser": "^0.4.1", - "katex": "^0.18.1" + "katex": "^0.19.1" }, "engines": { "node": ">=18.19.0" @@ -52,13 +51,10 @@ } }, "node_modules/@swc/helpers": { - "version": "0.5.23", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.23.tgz", - "integrity": "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.8.0" - } + "version": "0.5.24", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.24.tgz", + "integrity": "sha512-6tcXo4kA8HgGO7AVmawB57RYi/piBPYVHVcO6dXjX+SZw8GoHmi262sp4v2Ha2kNP9Cx84qei27yT+fjS1lxgg==", + "license": "Apache-2.0" }, "node_modules/@types/unist": { "version": "2.0.11", @@ -272,9 +268,9 @@ "license": "BSD-3-Clause" }, "node_modules/katex": { - "version": "0.18.10", - "resolved": "https://registry.npmjs.org/katex/-/katex-0.18.10.tgz", - "integrity": "sha512-/B6p9eY9DX7aHBfpkHdpirDTZ5QH9xTwL9y837PWuzuv41O5jFdqNQwVQEQsimY0/iVNkwBY4+4hMfhQ7d4Dbw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.19.1.tgz", + "integrity": "sha512-jG8uKntjSEcm2EpQOh0XturpPuuC9r3Sq5HLHdsFdWZT27E672SF19QEi+of0/YeOy15lDgRhKvr5614uRrEfA==", "dev": true, "funding": [ "https://opencollective.com/katex", @@ -361,12 +357,6 @@ "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", "license": "MIT" }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, "node_modules/unicode-properties": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", @@ -430,9 +420,9 @@ } }, "node_modules/x11": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/x11/-/x11-4.2.3.tgz", - "integrity": "sha512-bOO/uu8snPD/lYq5J0f1JJK6wWOOhlTbEiDS7YDH27BFhTyoN/thcirQ1wOSiBJtX6IqgXCJh73LAiCyNs0Eiw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/x11/-/x11-4.3.3.tgz", + "integrity": "sha512-scSNghvfgr4ak9tLt3jEAeldE0U641nyLfPPy17he5FrLKCLdSyvWoaTyCFHRPWZ5qldrEe8jeMNTAqm0aKWDg==", "engines": { "node": ">=18" } diff --git a/package.json b/package.json index d3304ed..fcf3013 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,6 @@ }, "devDependencies": { "@conventional-commits/parser": "^0.4.1", - "katex": "^0.18.1" + "katex": "^0.19.1" } } diff --git a/test/stroke-joins.test.js b/test/stroke-joins.test.js index c6b7b36..b85bdd9 100644 --- a/test/stroke-joins.test.js +++ b/test/stroke-joins.test.js @@ -130,9 +130,14 @@ test('and the whole square is symmetric, at every width and join', async () => { square(ctx); }); const { worst, where } = asymmetry(at); - // 1 is antialiasing rounding on the two axes; a missing join is a - // whole corner, which reads as 255 minus its edge coverage - assert.ok(worst <= 1, `${join} lineWidth ${lw}: asymmetry ${worst} at ${where}`); + // An odd width puts the edges on half pixels, and RENDER's Precise + // grid samples a pixel 17 columns by 15 rows: a half-covered pixel + // reads 119 or 136 along a horizontal edge, 120 or 135 along a + // vertical one, so the quarter turn costs up to 16 levels. XQuartz + // and node-x11's own server since 4.3.0 both give exactly that. A + // missing join is a whole corner: at least 71 levels at lineWidth 1, + // 255 from 2 up. + assert.ok(worst <= 16, `${join} lineWidth ${lw}: asymmetry ${worst} at ${where}`); } } }); diff --git a/test/xserver.test.js b/test/xserver.test.js index 7f3a99e..5c70022 100644 --- a/test/xserver.test.js +++ b/test/xserver.test.js @@ -778,8 +778,8 @@ test('protocol: AddTraps accumulates antialiased coverage', async () => { Render.CreatePicture(picId, pid, Render.a8); Render.FillRectangles(Render.PictOp.Src, picId, [0, 0, 0, 0], [0, 0, 8, 8]); - // half-pixel-tall full-width span: expect ~50% coverage on row 2, and two - // adds on the same span must accumulate to ~100% + // half-pixel-tall full-width span: about half coverage on row 2, and two + // more adds on the same span must accumulate to full coverage const span = [0, 8, 2, 0, 8, 2.5]; // top l/r/y, bottom l/r/y Render.AddTraps(picId, 0, 0, span); const one = await new Promise((resolve, reject) => @@ -787,7 +787,10 @@ test('protocol: AddTraps accumulates antialiased coverage', async () => { ); // depth-8 GetImage: one byte per pixel, rows padded to 4 (8 is aligned) const alphaAt = (img, x, y) => img.data[y * 8 + x]; - near(alphaAt(one, 4, 2), 128, 6, 'half-covered row'); + // RENDER's Precise grid for a8 is 17 samples by 15 rows, the rows at + // 1/30 + k/15 of the pixel; the top half holds 7 of them, and 7 × 17 = + // 119. pixman servers give exactly this, as node-x11's has since 4.3.0. + assert.equal(alphaAt(one, 4, 2), 119, 'half-covered row'); assert.equal(alphaAt(one, 4, 3), 0, 'row below untouched'); Render.AddTraps(picId, 0, 0, span);