Open anamauad opened 3 years ago
as design
Why not add a parameter to switch between these two behaviors?
I have the same problem.
Faced with the same issue, solved it next way:
Copied library as source code in my project and in the file extended_image_editor_utils.dart
uncommented line:
cropRect = rotateRect(cropRect, cropRect.center, -angle);
in rotate()
method (line 93).
Are there any other way to do it without editing library source code?
Encountered this issue today. Used the following workaround without modifying the lib: https://gitlab.com/roosemberth/Greenzz/-/commit/f1fce3509a1d86b05c717b8ec1a774cf4b80079a.
any update on this? after 2 years still the problem is left without any solution by the developers. I really like this package and prefer use the official one instead of my own modified version, but these problems need to be solved. Having a parameter for switching this behavior would be great.
@zmtzawqlp I completely understand that, but how about the case when we want to provide some standard aspect ratios like most editing apps? In that case, rotating the crop rectangle would be opposed to its goal.
I have tried many approaches (without editing the package's source code) to create a workaround with no luck and weird stuff happening.
Strangely, this rotate function works, as provided in the package's example:
void rotate(bool isToRight) async {
editorKey.currentState?.rotate(right: isToRight);
}
but this one, results in the cropRect to change, but the image will not rotate at all:
void rotate(bool isToRight) async {
editorKey.currentState?.rotate(right: isToRight);
setState(() {
if (_cropAspectRatio != null) {
_cropAspectRatio = 1.0 / _cropAspectRatio!;
}
});
}
I tried many many approaches, calling setState
with delays, in different orders, ... but no luck. And force-rebuilding the entire ExtendedImage
widget works but it will be flashy.
Isn't there any workaround to at least both rotate and change cropAspectRatio
? why this strange behavior happens that the image does not rotate at all when changing cropAspectRatio
?!
Has anyone found the solution to this?
Aspect is rotated when the image is rotated. It should not rotate, only the image should be rotated.
Steps to reproduce the problem:
The image is rotated 90 degrees, but the crop rectangle is also rotated. It turns out to be CropAspectRatios.ratio3_4.
I think that it should not rotate the crop rectangle.