From ed82e0daef3226e645b90210393d92fb73b8f00a Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Wed, 21 Jul 2021 17:24:12 -0700 Subject: [PATCH] Fix widget drop preview outline on 4x5 grids => We were not account for mBorderSpacing in the outline calculation => This was fine in most cases as this value is 0, but 4x5 appears to be the exception Bug: 194227752 Test: manual, see video in bug. Change-Id: Ib590bc142a0f65e75f92ee057f8b4f4b0f81521b --- src/com/android/launcher3/CellLayout.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 00278e479b..a6adfc4bf6 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -566,9 +566,10 @@ public class CellLayout extends ViewGroup { int spanX = mDragOutlines[i].cellHSpan; int spanY = mDragOutlines[i].cellVSpan; + // TODO b/194414754 clean this up, reconcile with cellToRect mVisualizeGridRect.set(paddingX, paddingY, - mCellWidth * spanX - paddingX, - mCellHeight * spanY - paddingY); + mCellWidth * spanX + mBorderSpacing * (spanX - 1) - paddingX, + mCellHeight * spanY + mBorderSpacing * (spanY - 1) - paddingY); int transX = x * mCellWidth + (x * mBorderSpacing) + getPaddingLeft() + paddingX;