|
24 | 24 | OBJECTS, |
25 | 25 | dropdown_option, |
26 | 26 | editor_point, |
| 27 | + panel_left, |
27 | 28 | panel_point, |
28 | 29 | window_size, |
29 | 30 | ) |
@@ -842,14 +843,38 @@ def selection(run_state: "RunState") -> None: |
842 | 843 |
|
843 | 844 | # Start in the sky, well above the map polygon, then sweep down-right over |
844 | 845 | # 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. |
846 | 849 | run_state.press(spot_x - 220, 80) |
847 | 850 | run_state.move(spot_x + 120, spot_y + 60, delay=Delay.FRAME) |
848 | 851 | run_state.move(spot_x + 200, spot_y + 160, delay=Delay.SETTLE) |
849 | 852 | # park=False: the box is drawn to the cursor, so it *is* the cursor position. |
850 | 853 | 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) |
852 | 868 | 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)") |
853 | 878 | run_state.golden("box-selected", crop=None, tolerance=MAP_TOLERANCE) |
854 | 879 |
|
855 | 880 | # Properties edits the *selected* object. If the box selected nothing, there |
|
0 commit comments