Skip to content

Commit 0d2b94e

Browse files
committed
Update offset logic
1 parent 3e25e9c commit 0d2b94e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

blurkit/src/main/java/io/alterac/blurkit/BlurLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ private Bitmap blur() {
219219
leftOffset = x + leftOffset >= 0 ? leftOffset : 0;
220220

221221
int rightOffset = xPadding;
222-
rightOffset = x + getWidth() + rightOffset <= screenWidth ? rightOffset : screenWidth - getWidth() - x;
222+
rightOffset = x + screenWidth - rightOffset <= screenWidth ? rightOffset : screenWidth + screenWidth - x;
223223

224224
int topOffset = -yPadding;
225225
topOffset = y + topOffset >= 0 ? topOffset : 0;
226226

227227
int bottomOffset = yPadding;
228-
bottomOffset = y + height + bottomOffset <= screenHeight ? bottomOffset : 0;
228+
bottomOffset = y + getHeight() + bottomOffset <= screenHeight ? bottomOffset : 0;
229229

230230
// Parent view bitmap, downscaled with mDownscaleFactor
231231
Bitmap bitmap;

0 commit comments

Comments
 (0)