use of org.signal.imageeditor.core.model.ThumbRenderer in project Signal-Android by WhisperSystems.
the class ImageEditorView method startAMoveAndResizeSession.
private EditSession startAMoveAndResizeSession(@NonNull Matrix inverse, @NonNull PointF point, @Nullable EditorElement selected) {
Matrix elementInverseMatrix;
if (selected == null)
return null;
if (selected.getRenderer() instanceof ThumbRenderer) {
ThumbRenderer thumb = (ThumbRenderer) selected.getRenderer();
EditorElement thumbControlledElement = getModel().findById(thumb.getElementToControl());
if (thumbControlledElement == null)
return null;
EditorElement thumbsParent = getModel().getRoot().findParent(selected);
if (thumbsParent == null)
return null;
Matrix thumbContainerRelativeMatrix = model.findRelativeMatrix(thumbsParent, thumbControlledElement);
if (thumbContainerRelativeMatrix == null)
return null;
selected = thumbControlledElement;
elementInverseMatrix = model.findElementInverseMatrix(selected, viewMatrix);
if (elementInverseMatrix != null) {
return ThumbDragEditSession.startDrag(selected, elementInverseMatrix, thumbContainerRelativeMatrix, thumb.getControlPoint(), point);
} else {
return null;
}
}
return ElementDragEditSession.startDrag(selected, inverse, point);
}
use of org.signal.imageeditor.core.model.ThumbRenderer in project Signal-Android by signalapp.
the class ImageEditorView method startAMoveAndResizeSession.
private EditSession startAMoveAndResizeSession(@NonNull Matrix inverse, @NonNull PointF point, @Nullable EditorElement selected) {
Matrix elementInverseMatrix;
if (selected == null)
return null;
if (selected.getRenderer() instanceof ThumbRenderer) {
ThumbRenderer thumb = (ThumbRenderer) selected.getRenderer();
EditorElement thumbControlledElement = getModel().findById(thumb.getElementToControl());
if (thumbControlledElement == null)
return null;
EditorElement thumbsParent = getModel().getRoot().findParent(selected);
if (thumbsParent == null)
return null;
Matrix thumbContainerRelativeMatrix = model.findRelativeMatrix(thumbsParent, thumbControlledElement);
if (thumbContainerRelativeMatrix == null)
return null;
selected = thumbControlledElement;
elementInverseMatrix = model.findElementInverseMatrix(selected, viewMatrix);
if (elementInverseMatrix != null) {
return ThumbDragEditSession.startDrag(selected, elementInverseMatrix, thumbContainerRelativeMatrix, thumb.getControlPoint(), point);
} else {
return null;
}
}
return ElementDragEditSession.startDrag(selected, inverse, point);
}
Aggregations