mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 11:52:23 +00:00
Image Editor - Keep image within crop bounds.
* 4% of original pixels must be visible. * The entire crop must be within the image. * On release, try to scale crop area and image to fit if the crop is invalid. * Undo to last valid position if that didn't work. * Additionally, center thumbs now do not respect aspect ratio lock.
This commit is contained in:
committed by
Greyson Parrelli
parent
068ffc2167
commit
bf759711ef
@@ -8,7 +8,7 @@ import org.thoughtcrime.securesms.imageeditor.model.EditorElement;
|
||||
|
||||
abstract class ElementEditSession implements EditSession {
|
||||
|
||||
private final Matrix inverseMatrix;
|
||||
private final Matrix inverseMatrix;
|
||||
|
||||
final EditorElement selected;
|
||||
|
||||
@@ -60,7 +60,7 @@ abstract class ElementEditSession implements EditSession {
|
||||
* @param matrix Matrix to transform point with.
|
||||
* @param src Input point.
|
||||
*/
|
||||
static void mapPoint(@NonNull PointF dst, @NonNull Matrix matrix, @NonNull PointF src) {
|
||||
private static void mapPoint(@NonNull PointF dst, @NonNull Matrix matrix, @NonNull PointF src) {
|
||||
float[] in = { src.x, src.y };
|
||||
float[] out = new float[2];
|
||||
matrix.mapPoints(out, in);
|
||||
|
||||
Reference in New Issue
Block a user