Restore widget drawing bottom row limitation

This commit is contained in:
Ensar Sarajčić 2023-07-17 11:59:22 +02:00
parent 3545701f21
commit 5d642eefe2

View File

@ -689,8 +689,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
if (rect.left < 0) { if (rect.left < 0) {
rect.right -= rect.left rect.right -= rect.left
rect.left = 0 rect.left = 0
} else if (rect.right > context.config.homeColumnCount - 1) { } else if (rect.right > columnCount - 1) {
val diff = rect.right - context.config.homeColumnCount + 1 val diff = rect.right - columnCount + 1
rect.right -= diff rect.right -= diff
rect.left -= diff rect.left -= diff
} }
@ -698,8 +698,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
if (rect.top < 0) { if (rect.top < 0) {
rect.bottom -= rect.top rect.bottom -= rect.top
rect.top = 0 rect.top = 0
} else if (rect.bottom > context.config.homeRowCount - 1) { } else if (rect.bottom > rowCount - 1) {
val diff = rect.bottom - context.config.homeColumnCount + 1 val diff = rect.bottom - rowCount + 2
rect.bottom -= diff rect.bottom -= diff
rect.top -= diff rect.top -= diff
} }