Fix widget resizing handles, edge anchoring, scroll sync, and axis limits
Launcher / test (pull_request) Successful in 1m19s
Launcher / apk (pull_request) Skipped

This commit is contained in:
Sprite committed 2026-11-23 05:29:33 +00:00
1 parent 216c80252d
commit bb978fd6de
13 files changed
+538 -76

No files matched your search

+13
View File
@@ -155,3 +155,16 @@ test "viewport to grid" {
assert_eq(rows_fit(500.0), 7)
assert_eq(rows_fit(10.0), 1)
}
///|
test "fit clamps anchored spans within lo..hi and negative targets" {
// Widget pinned at col 2 of 5 can only grow to hi = 3 columns on the right
assert_eq(fit(500.0, 1, 3, 65.2, 8.0, 64, 0), 3)
// Negative drag past the left/top edge clamps cleanly to 1
assert_eq(fit(-120.0, 1, 4, 65.2, 8.0, 0, 0), 1)
// Expanding a widget unpins slots now overlapped by it
let h = [widget(2, 2, x=1, y=1), app(x=3, y=1), app(x=0, y=0)]
h[0].w = 3
clear_cells(h, 0, 5)
assert_eq((h[1].x, h[1].y, h[2].x, h[2].y), (-1, -1, 0, 0))
}