Prevent multitouch from accidentally deleting stickers.

This commit is contained in:
Greyson Parrelli 2021-09-09 10:49:40 -04:00
parent 9f3765d368
commit b0d0814b88

View file

@ -306,7 +306,13 @@ public final class ImageEditorView extends FrameLayout {
if (editSession != null) {
editSession.commit();
dragDropRelease(false);
notifyDragEnd(editSession.getSelected(), checkTrashIntersect(getPoint(event)));
PointF point = getPoint(event);
boolean hittingTrash = event.getPointerCount() == 1 &&
checkTrashIntersect(point) &&
model.findElementAtPoint(point, viewMatrix, new Matrix()) == editSession.getSelected();
notifyDragEnd(editSession.getSelected(), hittingTrash);
editSession = null;
model.postEdit(moreThanOnePointerUsedInSession);