From 5d642eefe2cf4d4b4abfe0725b709e73deaeccc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Mon, 17 Jul 2023 11:59:22 +0200 Subject: [PATCH] Restore widget drawing bottom row limitation --- .../simplemobiletools/launcher/views/HomeScreenGrid.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt index c5a72443..b90bd054 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -689,8 +689,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel if (rect.left < 0) { rect.right -= rect.left rect.left = 0 - } else if (rect.right > context.config.homeColumnCount - 1) { - val diff = rect.right - context.config.homeColumnCount + 1 + } else if (rect.right > columnCount - 1) { + val diff = rect.right - columnCount + 1 rect.right -= diff rect.left -= diff } @@ -698,8 +698,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel if (rect.top < 0) { rect.bottom -= rect.top rect.top = 0 - } else if (rect.bottom > context.config.homeRowCount - 1) { - val diff = rect.bottom - context.config.homeColumnCount + 1 + } else if (rect.bottom > rowCount - 1) { + val diff = rect.bottom - rowCount + 2 rect.bottom -= diff rect.top -= diff }