Repository navigation
Conversation
|
Raised in review: does widening the resting inset fight the climb? Characters They don't fight, and the reason is that the climb never goes through anything
Pushed cd8e8fb to pin it for a wide one too, since that is the case the On BMO specifically: its widest frame is 126, so its clearance moves 64 → 63. — Cursor agent, on @omesser's behalf. |
cd8e8fb to
438af99
Compare
EDGE_CLEARANCE guessed at 64; Timber Wolf's half-width is 88, so it rested 24 points over the outermost edge, where no overlay draws it. Co-authored-by: Cursor <cursoragent@cursor.com>
…lear of Co-authored-by: Cursor <cursoragent@cursor.com>
438af99 to
b8305cd
Compare
|
Closing. The premise is wrong, and measuring the art rather than the frame The clearance here comes from the frame canvas width. These canvases are
This PR claimed "Timber Wolf's feet stop 64 from the edge and 24 points of art The one thing that does reach 88 is The PR argued past this in its own text: "the cost is a Character resting with It also never addressed the report that started it (#55-style disappearance): Kept for the record rather than deleted, in case a third-party Character — Cursor agent, on @omesser's behalf. |
Why
EDGE_CLEARANCEpromises that "the full sprite is on-screen when standing" andguesses at how wide a sprite is — 64 points, "enough for a character of typical
width". Two shipped Characters are wider than the guess. Timber Wolf's frames
are 176 points across, so its feet stop 64 from the edge and 24 points of art
hang past it; Jotaro clips by 22.
At a seam that would be harmless, because the neighbouring display's overlay
draws the other half. At the outermost edge there is no neighbour, so the
clipped part is drawn by nobody. #55 accepted seam clipping as "a brief pop
during a crossing, not a resting state" — this is the resting state.
The guess was made for Nim, which is why it fits Nim exactly: 32 points of art
at the default
scale = 4is 128 wide, and half of that is the 64 in theconstant. Every Character drawn at a different scale is one the guess was never
made for.
What changed
The Engine is told how wide its Character is.
EDGE_CLEARANCEstays as thefallback for an Engine nobody told, so existing callers keep today's behaviour.
Every edge the Engine keeps the sprite clear of — the display's and the Dock's —
is a distance from the feet, and how far that has to be is half a sprite, so
at_horizontal_edge,dock_side_reachedanddock_top_atnow take theclearance as a parameter rather than reading the constant.
Character::sprite_widthis the widest declared frame times the Character'sscale, and
Roster::spawnhands it over. The widest rather than the onecurrently drawing: the Engine holds this for the Instance's life, so it has to
cover whichever Animation is playing when the sprite reaches an edge. The whole
frame rather than the opaque pixels in it — measuring the ink would mean
remeasuring every frame, and the mask is the renderer's business; the cost is a
Character resting with its transparent padding off screen, which is invisible.
What this does to the shipped Characters:
Deliberately not fixed here: the climb.
wall_reachedpins the feet exactlyon the outermost edge and the climb frames assume the wall runs down the middle
of the frame, so a climb there is still half off screen — several seconds of it,
in the trace below. That is correct at a seam and wrong only at the outer edge,
and telling the two apart is its own change.
How to verify
cargo test --workspace— 637 pass.cargo clippy --workspace --all-targets -D warningsand
cargo fmt --checkare clean.Three tests, each confirmed to fail without the fix:
a_sprite_wider_than_the_default_clearance_rests_fully_on_screen— the Engineinvariant, asserted on the art's extent rather than on the constant so it
cannot quietly drift back.
a_spawned_instance_keeps_its_own_width_clear_of_the_display_edge— thewiring through
Roster::spawn. With thewith_sprite_widthcall removed itreports
the art's right edge is off screen: feet at 1856 put it at 2056.a_sprite_is_as_wide_as_its_widest_frame_blown_up_by_its_own_scale— pins thescale multiplication, the easiest part of this to get wrong.
The original reproduction, run through the Engine with the reporter's real
desktop (two displays, the right-hand one ending at x=3648).
drawnis how muchof the 176-point art falls inside any overlay:
The last line is what this fixes: it now rests at 3560, art flush with the edge.
Line 486's
drawn=88pxis the climb, left for another change.Notes
Diagnosing this turned up a second failure mode I did not touch: "over no
display" is the union of the display frames, not their bounding box, so a
desktop whose screens do not touch has a band between them where the feet have
no floor and no overlay. The reporter's arrangement had a 25-point gap at the
time. Worth its own issue if it bites.
Closes #327
— Cursor agent, on @omesser's behalf.
Made with Cursor