feat(editor): step controls for orientation, crop, look and output size

Owner review 1 asked for the Camera step to frame the picture the way the
mockup does, so the step now offers Aspect, Rotation (icon buttons), Mirror
and Flip switches, Straighten, Crop size, Crop X and Crop Y, and Reset
framing. Cropping by margins is gone: the crop box is now held to the chosen
aspect.

- EditorSession gains Orient and ResetFraming. Edit and Optimise refit a
  box that was already held to the aspect whenever the aspect or the export
  box changes, and do it in the same undo step. A crop from an older project
  that was placed by offsets is left for the render to fit.
- Straighten drives the preview's grid through the new SliderActivity
  attached behaviour, which a NumberRow switches on with ShowsGrid.
- Exposure gains a Look group with Filter and Strength. A newer project's
  extra look data is kept as it is.
- Export: Width and Height now edit the preset's own box, and a new Output
  size row shows the size after the chosen proportions are applied, marked
  Capped when the encoder shrinks it. ExportPlan carries OutputSize and
  EncodedSize.
- New SwitchRow, IconActionsRow and GroupRow rows with their panel
  templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-04 20:24:03 +01:00
1 parent aaf9c0bba7
commit 7413b72ecc
14 files changed
+1030 -100

No files matched your search

@@ -8,7 +8,7 @@ using Chronos.Testing;
namespace Chronos.App.Tests.Editor;
/// <summary>Composed texts of the editor (the conflict prompt among them), crop margins and the waveform monitor.</summary>
/// <summary>Composed texts of the editor (the conflict prompt among them, the Camera step's values) and the waveform monitor.</summary>
public sealed class EditorTextTests
{
static EditorTextTests() => _ = EditorFixture.Sunset;
@@ -38,22 +38,15 @@ public sealed class EditorTextTests
}
[Test]
public void CropMarginsKeepAtLeastATenthOfTheFrame()
public void TheCameraRowsShowAnglesAndPlacementsAsTheMockupDoes()
{
Assert.SequenceEqual([0.0, 0, 0, 0], CropMargins.Of(null));
var crop = CropMargins.With(null, CropSide.Left, 0.2);
Assert.SequenceEqual([0.2, 0, 0.8, 1], crop!);
crop = CropMargins.With(crop, CropSide.Top, 0.6);
Assert.Approximately(CropMargins.MaxMargin, crop![1], 1e-12, "no margin beyond the maximum");
crop = CropMargins.With(crop, CropSide.Left, 0.45);
crop = CropMargins.With(crop, CropSide.Right, 0.45);
Assert.Approximately(CropMargins.MinSize, crop![2], 1e-12, "opposite margins leave a tenth of the width");
var margins = CropMargins.Of(crop);
Assert.Approximately(0.45, margins[0], 1e-12);
Assert.Approximately(0.45, margins[1], 1e-12);
Assert.Null(CropMargins.With(CropMargins.With(CropMargins.With(crop, CropSide.Left, 0), CropSide.Right, 0), CropSide.Top, 0),
"no margin left is the whole frame");
Assert.SequenceEqual([0.0, 0, 0, 0], CropMargins.Of([double.NaN, 0, 1, 1]), "an invalid crop is ignored, as the render does");
Assert.Equal("−1.2°", CameraTab.Degrees(-1.2), "a minus sign, one decimal");
Assert.Equal("15.0°", CameraTab.Degrees(15));
Assert.Equal("0°", CameraTab.Degrees(0), "level reads as a whole number");
Assert.Equal("0°", CameraTab.Degrees(-0.0), "never a negative zero");
Assert.Equal("+0.40", EditorText.Placement(0.4));
Assert.Equal("−0.60", EditorText.Placement(-0.6));
Assert.Equal("Centred", EditorText.Placement(0));
}
[Test]