Conversation
) Adds a tilt (perspective/skew) tool to the crop-rotate editor, ported onto the current stable layout. - Tilt UI (rotate/horizontal/vertical rulers) via a TiltProvider, gated by the new CropRotateTool.tilt entry and TiltConfigs (hidden in the video editor since non-quarter rotations aren't natively exportable). - Auto-zoom bounds: the crop selection can never leave the tilted image. _setOffsetLimits keeps the crop rect inside the convex image quad via half-plane erosion and binary-searches the minimal zoom; manual vs tilt-induced zoom are tracked separately so straightening zooms back out, and the tilt is clamped when maxScale can't keep the crop covered. - A single transform composition (scale -> translate -> tilt as separate centered transforms) is shared by the live preview, TransformedContentGenerator, the bounds math and the darken mask, so the preview matches the exported result under perspective. - Perspective-aware darken overlay in CropCornerPainter. - Tilt angles are serialized in TransformConfigs for export/import. Adds unit/widget tests for the tilt provider, rulers, the auto-zoom bounds math and the tilt-aware darken mask.
Pressing Esc in the main editor when it is the root route called Navigator.pop with an empty history, throwing "Bad state: No element". Guard both onCloseEditor pops with Navigator.canPop so closing is a safe no-op when there is nothing to pop.
The tilt is baked into the exported image, but consumers using onCompleteWithParameters (re-applying transforms themselves instead of using the rendered bytes) had no way to know about it. Add tiltRotate/tiltHorizontal/tiltVertical to CompleteParameters (toMap, fromMap, copyWith, toString) and populate them from the active TransformConfigs in both the main editor and the crop editor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #525 — adds a tilt (perspective/skew) transform to the crop-rotate editor, ported onto the current
stablelayout (usingorigin/feat/skewingas reference; its directory reorg was intentionally not adopted).What's included
TiltProvider, exposed through the newCropRotateTool.tiltbottom-bar entry andTiltConfigs/TiltStyle/TiltWidgets. Hidden in the video editor by default (non-quarter rotations aren't natively exportable)._setOffsetLimitskeeps the crop rect inside the convex image quad via half-plane erosion and binary-searches the minimal zoom. Manual vs. tilt-induced zoom are tracked separately, so straightening the image zooms back out to (but never below) the user's manual zoom; the tilt is clamped whenmaxScalecan't keep the crop covered.scale → translate → tilt, applied as separate center-aligned transforms) is shared by the live preview,TransformedContentGenerator(export + main editor), the bounds math and the darken mask, so the preview matches the exported result under perspective.CropCornerPainter(follows the tilted image quad, preserving the [Bug]: In the cCropRotateEditor, when the image is at the bottom, the top edge of the image is not covered by crop OverlayOpacity #776 overscan and feat(crop-rotate): keep aspect ratio orientation on rotate #829 frame-opacity behavior).TransformConfigs(export/import).Also
fix(example): guardonCloseEditorpops withNavigator.canPop— pressing Esc in the root-route editor previously crashed withBad state: No element.Tests
fitCropInsideTiltedImage) and the tilt-aware darken mask.flutter analyzeclean; full suite green (480 tests).Notes