Documentation
¶
Overview ¶
Package main provides a one-time migration tool to convert fixture layout coordinates from normalized 0-1 values to pixel-based coordinates.
Usage: go run ./cmd/migrate-layout
This script: 1. Finds all fixtures with layoutX/layoutY values strictly between 0 and 1 2. Converts them to pixel coordinates (normalized * canvasSize) 3. Uses the project's layoutCanvasWidth/Height (defaults to 2000x2000)
The script is idempotent - it only converts values that appear to be normalized (strictly between 0 and 1, exclusive). Values exactly at 0 or 1 are treated as pixel coordinates to avoid false positives for fixtures at canvas edges. This matches the resolver's backward-compatibility logic.
EDGE CASE NOTE: Fixtures legitimately positioned at exactly 0.0 or 1.0 in normalized coordinates will NOT be converted by this migration. Such fixtures would remain at 0 or 1 pixels instead of being scaled to canvas dimensions. This is an accepted trade-off to prevent false positives with fixtures that are already at pixel positions 0 or 1. In practice, fixtures at exact edge positions are rare, and users can manually adjust them if needed.