Skip to content

Catch the sprite in gaps between displays - #51

Merged
omesser merged 1 commit into
mainfrom
feat/4-union-bounds
Aug 29, 2026
Merged

omesser merged 1 commit into
mainfrom
feat/4-union-bounds

Conversation

@omesser

@omesser omesser commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Physics clamped to the rectangle that bounds the displays, not the union of their frames. Two displays with a gap between them bound a region no screen covers — and a sprite let go there falls for ever, unseen.

A test drops one into the gap and it reaches y = 15598, still accelerating.

Why it survived this long

The fix

Being over no display is what catches an edge now, rather than being past the outermost edge. Those were always the same thing; only the second was checked.

  • Every inner edge stays somewhere to cross, not something to stop at — displays that touch are still crossed freely, and there is a test for it.
  • Retires the ponytail: comment on wall_reached, which named this issue as the hook to clamp at.

The other two arrangements

#4 also asks for L-shaped and diagonal layouts. Neither strands anything: every x in their bounding rectangles is spanned by some display, so there is always a floor somewhere below. They get tests saying so rather than an assumption, because that is not obvious from the arrangement.

The third criterion needs no code

"Crosses between displays of differing resolution at a stable apparent size." The sprite is sized in points end to end — the Engine, place_sprite and the webview's CSS pixels are one space, and the backing scale is resolved by the compositor at render time. Crossing itself is exercised on #49, where the cursor conversion that makes a drag cross at all is being fixed.

Verify

cargo test -p ai-buddy-core   # 97, four of them new

Removing the clamp fails three tests, including one that predates this change.

Merges cleanly with #49 in either order — checked both ways.

Closes #4

🤖 Generated with Claude Code

@omesser
omesser force-pushed the feat/4-union-bounds branch from e10b436 to 0a0df06 Compare August 29, 2026 19:24
Physics clamped to the outermost edges of all displays, which is the rectangle
that bounds them rather than the union of their frames. Two displays with a gap
between them bound a region no screen covers, and a sprite in it is over
nothing: `floor_under` finds no display at that x, `support_below` returns
nothing, and it falls, unseen, for as long as the app runs. A test that lets go
of one over the gap reaches y=15598 and is still accelerating.

Only a drop finds this. A thrown sprite carries enough sideways speed to clear
the gap before gravity matters, which is why the defect survived the throw tests
that have been there since #3 — and why it became reachable the moment Grab
landed and a hand could carry the sprite there deliberately.

So being over no display, rather than being past the outermost edge, is what
catches an edge now. The two cases were always the same thing; only the second
was checked. Every inner edge stays somewhere to cross rather than something to
stop at, so displays that touch are still crossed freely.

That retires the `ponytail:` comment on `wall_reached`, which named this issue
as the hook to clamp at.

The L-shaped and diagonal arrangements #4 also asks for turn out not to strand
anything: every x in their bounding rectangles is spanned by some display, so
there is always a floor somewhere below. They get tests saying so rather than an
assumption, since the reasoning is not obvious from the arrangement.

The third criterion needs no code. Apparent size is stable across displays of
differing resolution because the sprite is sized in points from end to end —
the Engine, `place_sprite`, and the webview's CSS pixels are one space, and the
backing scale is resolved by the compositor at render time. Crossing between
displays is exercised on #6's branch, where the cursor conversion that makes a
drag cross at all is being fixed.

Closes #4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@omesser
omesser force-pushed the feat/4-union-bounds branch from 0a0df06 to aca21de Compare August 29, 2026 19:24
@omesser
omesser merged commit 34fc062 into main Aug 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Physics: true union bounds and cross-display sizing

1 participant