CI was red on d4fc425 with two checks, both from this week's work.
- Signing out builds the editor anew on the same renderer. The second
useCursorFiles then took the SVG pointers of the first for Pixi's
own styles, so switching the option off kept them. The editor now
undoes the pointers on dispose and Pixi's styles are back in place.
- e2e 62d still looked for "Start recording". The menu reads "Start
recording…" since ba01d14, and 62 had not run then.
Tests:
- e2e 45, 46 and 62 on melektaus-atx: ALL PASSED, 51 checks
- Without the dispose, 46i-ii is red after 45, as it was in CI
- Gate, measured together with #419 on top: 305 files, 4714 tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A recording of the editor is as large as its canvas, and so far the
canvas always followed the window. With ?w=1920&h=1080 the editor is
laid out at exactly that size in CSS pixels, whatever the window.
- src/ui/pageSize.ts reads w and h (both needed, 200 to 8192 each) and
works out how the canvas fits the window.
- A smaller window shows the canvas shrunk to fit, centred, with the
same aspect. A larger one shows it 1:1, centred on a dark page.
- Clicks still land right, since Pixi maps them over the canvas's
on-screen box. Switching projects keeps w and h in the URL.
- The pointer drawn into an editor recording now scales against the
layout size, so a shrunk canvas still records a full-size pointer.
Tests:
- Unit page-size: 5 new, green.
- e2e 62d: ?w=1600&h=900 in a 960x720 window gives a 1600x900 canvas
shown at 960x540, y 90, and a click on the menu button opens it.
Red without the shrinking.
- Gate on melektaus-atx: 304 files, 4691 tests green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactoring round 9 covers everything since round 8 (14972d0): 62
commits with about 29 000 new lines in src, api, tools and tests.
Behaviour is unchanged. The one fix is in a check: e2e 04 counted 25
asset types, and the shader function from #303 makes 26, so the run
of a526e1b failed there.
Duplicate code (jscpd over src, 50 tokens, without the two licence
texts: 35 clones / 289 lines before, 29 / 232 after):
- ShaderPicture (new, viewport/shaderPicture.ts) is the picture a
camera's shader and a particle field's shader are laid over. It
keeps the render texture while its size holds and frees the
replaced one once the shader holds the new one. CameraShade and
ParticleField.shadeField drew it the same way, line for line.
- CameraShade builds its mesh on the first draw. Before, every redraw
of a view without a camera shader built a mesh and threw it away.
- emptyHost in inspector/host.ts builds the empty host the Inspector,
the Variables tab and the Tilemap panel start from.
- paddedQuad(null) is the plain unit quad. symbols.ts and
shaderPasses.ts each wrote it out by hand.
- In graph/nested.ts, calls of shader functions and On behavior
nodes are followed by one walk, `reaches`, over ids `namedBy` a
node type.
Dead code:
- ShaderEditor.colorFieldOf and the getter CurveCanvas.snapping had
no reader.
- 22 values used only in their own file lose their `export`. Types
and the node catalogues of shaders and particles stay exported.
- Kept on purpose: PhysicsSystem.holdsJoint is read by tests only,
but it is their one view of whether a joint holds.
- A pass with stricter lint rules over every file changed since
round 8 found no bug. PixelArtEditor.started is now readonly.
Comments and docs:
- Ten comments told history ("since #190", "used to", "any more").
They now describe what is. The bundle is md5-identical before and
after, and the four e2e files minify to the same bytes.
- README: joint and shader function in the asset list, joints on the
Physics row, what the Shaders page covers, two CI runners.
- e2e 04 keeps the number of asset types once, as ASSET_TYPE_COUNT.
- screenshot.png in the README is a new picture of the editor
(3840x2160 instead of 1825x1140), taken by the user.
Tests:
- Gate on melektaus-atx: 229 files, 3514 tests, CHECK EXIT 0
(+3 for emptyHost, +1 for the unit quad).
- e2e 1-4, 31, 63 on melektaus-atx: ALL PASSED, 195 checks. That is
the + menu of 04, the field shader of 31 and the camera shader of
63, both through ShaderPicture.
- No new e2e check, so the sum stays 1728.
- Counter-checks, each put back and compared with cmp: reaches that
never goes on fails 1 test, listensTo reading the wrong parameter
fails 1, emptyHost dropping what a panel hands in fails 1, folding
without a relayout fails 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a screen scaled to 125 % or 150 % the editor looked soft beside
a page the browser draws itself. The layout counts in whole CSS
pixels, and most of those fall between two device pixels there. The
GPU averages both: text loses its edges, and a 1 px line becomes a
pixel and a half of mixed colour. Now text and boxes are rounded to
device pixels, and a line is one device pixel wide.
- ui/pixelGrid.ts holds the rule. crispText() makes a text with
Pixi's roundPixels, crisp() does the same for a Graphics of
upright boxes, and hairline() is the width of one device pixel.
- Every text of the interface is made with crispText() instead of
new Text().
- crisp() only rounds where the scale is not a whole number. At
100 % and 200 % nothing changes.
- drawControlBox, drawHeaderBar and drawSectionBand draw their
lines a hairline wide and flush with the edge. The widgets that
draw lines of their own do the same.
- Two bands share exactly the line they draw, and a column still
ends on a whole pixel.
- The stage is nudged by 1/32 px where the scale is not whole. At
150 % every odd pixel is an exact half, and without the nudge one
band came out a row shorter than its neighbours.
- Curves, icons and everything of the game stay unrounded. Rounding
their points would bend them.
- The harness takes deviceScaleFactor as an option, and the hooks
deviceColumn, edgeContrast and pixelGrid read the frame as the
screen gets it.
Not in here: the subpixel smoothing a browser gives its own text.
Pixi draws a text into a transparent picture first, and there only
greyscale smoothing is possible.
Measured at 150 %, edge contrast before and after: top bar 31.5 to
47.8, the lists on the left 68.6 to 86.4, inspector 27.6 to 38.4.
At 100 % it is 46.5, 90.1 and 37.9, and the picture there is the
same as before pixel for pixel, apart from the fps display.
Tests:
- Gate on melektaus-atx: 206 files, 3114 tests (3104 + 10), exit 0
- Full run on melektaus-atx: 1655 of 1656 checks passed, smokes
24/19/21. The one that failed was a condition of the new step
62 itself: it scrolled an inspector that had nothing to scroll.
The step now makes the window lower for that reading.
- e2e 61,62 after that fix: 14 checks. The full run was not
repeated, and CI is switched off for now.
- Ten unit tests, nine in tests/ui/pixel-grid.test.ts
- Eight e2e checks in the new step 62, which runs at 150 %
- Eleven unit counter-probes fail tests
- Four browser counter-probes fail their checks. They ran before
the fix to step 62 and were not repeated for it.
- Screenshots looked at for 125 % and 150 %
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>