Implement Aspect Ratio Cropping#1
Merged
Merged
Conversation
Changes: - Refactored `CropShape` with a new `AspectRatio` option to allow cropping with fixed aspect ratios. - Added `CropShape.Original` to maintain the image's original aspect ratio. - Renamed `Gridlines` enum to `GridLinesVisibility` for clarity. - Introduced a new enum `GridLinesType` customize the visual appearance of gridlines. - Updated `CropOptions` to include `gridLinesType`. - Modified `ImageCropper` to draw gridlines based on `gridLinesType` and `gridLinesVisibility`. - The dark overlay outside the crop area now considers `gridLinesType` to determine its shape (rectangle or oval). - Updated `CropStateManager` to handle aspect ratio constraints during dragging and initialization. - Added `CropRatio` object with predefined common aspect ratios. - Updated the demo app to showcase new aspect ratio and gridline features. - Bumped library version to 1.1.0. - Removed `isSquareBounds()` extension function as it's no longer needed with the new `CropShape` sealed class.
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.
Description
This update now developers to apply any desired aspect ratio for the crop rectangle.
Changes
CropShapewith a newAspectRatiooption to allow cropping with fixed aspect ratios.CropShape.Originalto maintain the image's original aspect ratio.Gridlinesenum toGridLinesVisibilityfor clarity.GridLinesTypecustomize the visual appearance of gridlines.CropOptionsto includegridLinesType.ImageCropperto draw gridlines based ongridLinesTypeandgridLinesVisibility.gridLinesTypeto determine its shape (rectangle or oval).CropStateManagerto handle aspect ratio constraints during dragging and initialization.CropRatioobject with predefined common aspect ratios.isSquareBounds()extension function as it's no longer needed with the newCropShapesealed class.Please include a summary of the changes and the related issue. Please also include relevant
motivation and context. List any dependencies that are required for this change.
Type of change