Skip to content

Underlay bug fixes #96

@trailcode

Description

@trailcode

Underlay bug fixes

Problem

Edge calibration (Set X / Set Y from edge) can produce a general planar affine on the underlay (bitmap U and V not necessarily perpendicular—shear). The sketch properties panel still exposes only center, half width, half height, and rotation. That is a five-parameter orthogonal model. It cannot represent a sheared affine, so any code path that rebuilt the underlay from those sliders was replacing the real mapping with a different one. In practice, repeating Set Y or reloading the panel could make it look like X calibration was undone—because the stored affine was being overwritten by an orthogonal approximation, not because the edge math was necessarily wrong.

Root cause

We need a six-parameter affine (or equivalent: base point + two independent axis vectors) in the UI and in apply logic so users can inspect and edit the full mapping. Until that exists, orthogonal-only controls are unsafe whenever shear is present.

What this branch fixes

  • Stops applying the orthogonal transform when the underlay axes are not perpendicular, so slider/InputDouble paths cannot clobber a sheared calibration.
  • Disables those transform controls when shear is present and shows a clear panel message explaining why (no silent data loss).
  • Renders sheared underlays on a path that matches the affine (rectangular path only when axes are orthogonal).
  • Calibration UX: Set X / Set Y / Define datum flows, prompts, and related sketch/underlay plumbing as implemented on this branch (see diff vs main).
  • Tests updated where underlay behavior changed.

This is a bugfix and guardrail release, not the full six-parameter affine editor.

Still required (product gap)

Six-parameter affine editing in the panel (and apply path) so users can adjust position, scale, rotation, and shear without relying only on edge picks. Tracked in bugs.md.

Review notes

  • Focus: underlay affine consistency, GUI apply vs underlay_axes_orthogonal(), sheared display path.
  • Smoke: import image → Set X → Set Y (possibly twice) → confirm calibration stable; open panel → no unexpected rescale.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions