Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aacb8154 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix bug in getVisualCenter where we do not offset by the dragRegion."...

Merge "Fix bug in getVisualCenter where we do not offset by the dragRegion." into ub-launcher3-master
parents eeb5c337 23c2a024
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -78,17 +78,17 @@ public interface DropTarget {
         */
        public final float[] getVisualCenter(float[] recycle) {
            final float res[] = (recycle == null) ? new float[2] : recycle;
            Rect dragRegion = dragView.getDragRegion();

            // These represent the visual top and left of drag view if a dragRect was provided.
            // If a dragRect was not provided, then they correspond to the actual view left and
            // top, as the dragRect is in that case taken to be the entire dragView.
            // R.dimen.dragViewOffsetY.
            int left = x - xOffset;
            int top = y - yOffset;
            int left = x - xOffset - dragRegion.left;
            int top = y - yOffset - dragRegion.top;

            // In order to find the visual center, we shift by half the dragRect
            res[0] = left + dragView.getDragRegion().width() / 2;
            res[1] = top + dragView.getDragRegion().height() / 2;
            res[0] = left + dragRegion.width() / 2;
            res[1] = top + dragRegion.height() / 2;

            return res;
        }