Add headless regression tests for Prop Editor functionality
- Implement tests for PropFile, including preset conversion, file dictionary conversion, round-trip serialization, version rejection, default values for missing keys, flattening, sanitization, and save/load functionality. - Create tests for PropEditor, covering window title formatting, mode button text, safe saving, and recent file list management. - Add tests for PropTheme, validating fallback behavior, invalid input handling, and default values for primitives and UI tokens. - Introduce tests for ThumbnailCache, ensuring proper key formatting, PNG handling, and behavior with missing files.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# Phase 9 Prop Editor — Round 7 (Two-Tone Halo Selection)
|
||||
|
||||
Status: **implemented** (2026-09-19; direct follow-up on the Round 6 selection-contrast fix).
|
||||
|
||||
Source: one user feedback point — the Round 6 contrast approach did not fix the reported
|
||||
case.
|
||||
|
||||
## Diagnosis
|
||||
|
||||
Round 6 made the selection color adaptive to the *selected shape's fill* (dark on light
|
||||
fills, white on dark fills). That solves "white shape selected on a dark canvas" but not the
|
||||
reported case: a shape sitting **in front of a white shape** — the selection outline, bounding
|
||||
box, rotation dot, and scale crosses extend beyond the selected shape onto the white shape
|
||||
behind it, so a white (or fill-mismatched) selection still blends into the white background.
|
||||
Fill-based contrast fundamentally cannot know what is behind the shape.
|
||||
|
||||
## Fix
|
||||
|
||||
Every selection element now uses a **two-tone halo**: a dark backing pass (`SELECTION_HALO_COLOR`,
|
||||
black at 0.85 alpha, ~2 px wider) drawn first, then a bright core pass (`SELECTION_CORE_COLOR`,
|
||||
white, the original width) on top. The pair is visible on any background — the dark halo
|
||||
separates the bright core from light/white surroundings, and the bright core separates it from
|
||||
dark surroundings. Applied to:
|
||||
|
||||
- the selection polyline over the shape outline,
|
||||
- the bounding box (dark 3.5/zoom pass + white 1.5/zoom pass),
|
||||
- the rotation dot (dark ring at radius + 2, white dot at radius),
|
||||
- the four scale crosses (dark 3.5 pass + white 1.5 pass),
|
||||
- vertex handles in Reshape mode (a 1.5 px dark ring behind each handle).
|
||||
|
||||
The Round 6 `contrast_color_for` helper was removed. `SELECTION_COLOR`/`GIZMO_COLOR` were
|
||||
replaced by `SELECTION_CORE_COLOR`/`SELECTION_HALO_COLOR`.
|
||||
|
||||
## Changes
|
||||
|
||||
| Target | Change |
|
||||
| --- | --- |
|
||||
| `scripts/prop_canvas.gd` | Halo constants; two-pass drawing for selection polyline, bbox, rotation dot, scale crosses, vertex handles; `contrast_color_for` removed. |
|
||||
| `tests/test_prop_editor_canvas.gd` | `_test_selection_contrast` replaced by `_test_selection_halo` (halo is dark, core is bright). |
|
||||
|
||||
## Verification
|
||||
|
||||
- `--check-only` clean; all five suites green (file 68, theme 53, canvas 100, thumb 10,
|
||||
round3 21).
|
||||
- Manual F6: select a dark shape in front of a white shape, and a white shape in front of a
|
||||
white shape — the outline/box/dot/crosses must be visible in both; repeat in Reshape mode
|
||||
for the vertex handles.
|
||||
Reference in New Issue
Block a user