MCDE dtphoto: every menu path bound, the View switches drawn and read

All 206 paths of dtphoto.menu resolve to a command the callback switches
on.  The table had 43 doubled entries and 11 paths that named a menu
entry the menu does not have ("Image/Adjust/Image Size..." instead of
"Image/Image Size...", "@3.0" tags the reader already strips); both are
gone, CommandOf walks the table to its NULL entry, and -menutest now
proves the table against itself: 206 paths, 0 doubled, 0 bad, and an
unknown path stays CMD_NONE.  DTPHOTO_CMDS=1 used to bind 38, now 206,
none on CMD_NONE.

The View switches were flags nobody read.  SnapX/SnapY pull a marquee or
crop drag onto the grid or a guide a guide in reach wins over the grid,
Lock Guides refuses new and keeps existing ones), DrawGuides paints the
grid, the guides and the rulers on the canvas and not into the picture.

Two new headless tests, both green on depth 24 and depth 8:
  -viewtest  snapping arithmetic: 37 -> 32 on a 16 grid, 40 -> 48, a
             guide at 35 catches 37, a vertical guide leaves y alone,
             locked guides neither grow nor clear.
  -drawtest  counts the pixels on a real pixmap: grid 12509, one guide
             280 (= the canvas height), rulers 558 and none of them
             inside the canvas.

Measured: drawtest, viewtest, menutest, optest, selmodtest, retouchtest,
selecttest, movetest, croptest, typetest -> 20 green, 0 red (10 tests x
depth 24/depth 8); -selftest PASS on both, byte-identical output.
This commit is contained in:
lotherk committed 2026-11-22 13:09:53 +00:00
1 parent 0d0a144d66
commit 4cfd730565
2 files changed
+6114 -122

No files matched your search

+13 -2
View File
@@ -122,8 +122,19 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt
has "Horizontal" in Image > Flip and in Layer > Type, and the label
alone cannot tell them apart. `CommandOf` takes "menu/sub/item", the
reader stores it in `Item.path`, and `-menutest` proves every path
resolves to the command the callback switches on (31 paths, measured
2026-11-22). `DTPHOTO_CMDS=1` prints what the loaded menu file bound.
resolves to the command the callback switches on, that no path is
claimed twice and that a path nobody knows stays CMD_NONE (206 paths,
0 doubled, measured 2026-11-22). The table ends at its NULL entry so
the test walks it without knowing the length. `DTPHOTO_CMDS=1` prints
what the loaded menu file bound: 206 of 206, none on CMD_NONE. Every
menu path in `dtphoto.menu` resolves, so a bound entry is a wired one.
The View switches are read, not just flipped: `SnapX`/`SnapY` pull a
marquee or crop drag onto the grid or a guide, `DrawGuides` paints the
grid, the guides and the rulers on the canvas (not into the picture),
and `-viewtest` checks the snapping arithmetic while `-drawtest`
counts the pixels the decorations add on a real pixmap. A flag that
only toggles itself is a menu entry that does nothing, which is why
both tests exist.
`dtphoto -optest|-menutest` are headless too: the operations are checked
against the arithmetic (a hard edge blurred to 170, the same edge
sharpened clamped to 255 and 0, a mosaic cell to its mean) and not
+6101 -120
View File
File diff suppressed because it is too large. Load diff