Skip to content

Compare the layout sweep's unrounded edges instead of rounding each value - #6404

Merged
max-sixty merged 1 commit into
mainfrom
unrounded-box-sweep
Nov 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
unrounded-box-sweep

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

What changes

The layout box sweep (DEFINE_BOXES, displaced) now reads each watched control's left, top, right and bottom unrounded from getBoundingClientRect() and compares them exactly. The sixth Math.round(box.right) field added in #6398 is gone, since an unrounded right edge needs no special field. Failure messages report (left, top, right, bottom).

Why

Rounding each value is a tolerance with fixed boundaries: an edge moving from 804.49 to 804.51 reads as a 1 px move, and a 0.4 px move inside a bucket reads as none. #6398 fixed one case of this (a right edge that never moved, read as 805 then 804, failing test_the_poll_leaves_the_panel_where_it_was on macOS); this removes the cause.

Evidence

Exact comparison adds no constant. On macOS, the poll test, the whole-row detection test and all seven test_each_control_archetype_holds_its_neighbours_still cases pass with it, so no run showed sub-pixel noise on boxes that didn't move; the abs(a - b) <= 0.5 tolerance is not needed.

Refs #6392

This was written by Claude Code on behalf of max-sixty

…each value

Rounding each box value is a tolerance with fixed boundaries: an edge from 804.49 to
804.51 read as a pixel's move, and half a pixel inside a bucket read as none. The sweep
now reads left, top, right and bottom from getBoundingClientRect and compares them
exactly; the sixth right-edge field is gone. Behavior changed: the sweep fails on any
sub-pixel move of a watched box.
@max-sixty
max-sixty merged commit f48547c into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the unrounded-box-sweep branch November 18, 2026 20:49
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.

2 participants