Skip to content

Commit 0217234

Browse files
committed
Keep map selections alive across panels
1 parent e98b0f4 commit 0217234

6 files changed

Lines changed: 32 additions & 9 deletions

File tree

native/src/sbc/events/order.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ impl ListenerId {
5555
Self::Chonsole,
5656
Event::MouseMove | Event::MousePress | Event::MouseRelease | Event::MouseWheel,
5757
) => -10,
58+
(Self::State, Event::MouseMove) => 0,
5859
(
5960
Self::Panel,
6061
Event::MouseMove | Event::MousePress | Event::MouseRelease | Event::MouseWheel,
61-
) => 0,
62-
(
63-
Self::State,
64-
Event::MouseMove | Event::MousePress | Event::MouseRelease | Event::MouseWheel,
6562
) => 10,
63+
(Self::State, Event::MousePress | Event::MouseRelease | Event::MouseWheel) => 20,
6664
_ => 0,
6765
}
6866
}
9.21 KB
Loading
8.18 KB
Loading
-134 Bytes
Loading
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"box-dragging": {
33
"status": "ai-reviewed",
4-
"updated": "2026-07-27T01:54:53+00:00"
4+
"updated": "2026-07-29T23:47:02+00:00"
55
},
66
"box-selected": {
77
"status": "ai-reviewed",
8-
"updated": "2026-07-27T01:54:53+00:00"
8+
"updated": "2026-07-29T23:47:02+00:00"
99
},
1010
"props-after-box-select": {
1111
"status": "ai-reviewed",
12-
"updated": "2026-07-27T01:54:53+00:00"
12+
"updated": "2026-07-29T23:47:02+00:00"
1313
}
1414
}

tools/e2e/scenarios/objects.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
OBJECTS,
2525
dropdown_option,
2626
editor_point,
27+
panel_left,
2728
panel_point,
2829
window_size,
2930
)
@@ -842,14 +843,38 @@ def selection(run_state: "RunState") -> None:
842843

843844
# Start in the sky, well above the map polygon, then sweep down-right over
844845
# the feature. This used to fail in the Rust port because it required the
845-
# first corner to trace to ground.
846+
# first corner to trace to ground. Continue the same map-owned gesture over
847+
# the panel and release there: UI hit-testing must not hide its movement or
848+
# steal its release.
846849
run_state.press(spot_x - 220, 80)
847850
run_state.move(spot_x + 120, spot_y + 60, delay=Delay.FRAME)
848851
run_state.move(spot_x + 200, spot_y + 160, delay=Delay.SETTLE)
849852
# park=False: the box is drawn to the cursor, so it *is* the cursor position.
850853
run_state.golden("box-dragging", crop=None, tolerance=MAP_TOLERANCE, park=False)
851-
run_state.release(spot_x + 200, spot_y + 160)
854+
855+
release_x = panel_left(run_state) + 250
856+
release_y = spot_y + 160
857+
run_state.move(release_x, release_y, delay=Delay.SETTLE)
858+
crossing = run_state.screenshot("box-over-panel")
859+
crossing_outline = run_state.count_color(
860+
crossing,
861+
(0, 70, panel_left(run_state), height - 170),
862+
SELECTION_RECTANGLE_COLOR,
863+
fuzz="5%",
864+
)
865+
if crossing_outline < 100:
866+
raise AssertionError("rectangle-select stopped updating after the pointer crossed a panel")
867+
run_state.release(release_x, release_y)
852868
run_state.move(spot_x + 400, spot_y + 300, delay=Delay.DIALOG)
869+
selected = run_state.screenshot("box-selected")
870+
lingering = run_state.count_color(
871+
selected,
872+
(0, 70, panel_left(run_state), height - 170),
873+
SELECTION_RECTANGLE_COLOR,
874+
fuzz="5%",
875+
)
876+
if lingering > 100:
877+
raise AssertionError(f"release over a panel left the rectangle-select outline behind ({lingering} px)")
853878
run_state.golden("box-selected", crop=None, tolerance=MAP_TOLERANCE)
854879

855880
# Properties edits the *selected* object. If the box selected nothing, there

0 commit comments

Comments
 (0)