Fix vertical centering of icons in folder icon

This commit is contained in:
Ensar Sarajčić 2023-08-22 14:45:19 +02:00
parent a7ffb6328a
commit 7a5c698322
1 changed files with 1 additions and 1 deletions

View File

@ -1522,7 +1522,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
val scaledCellSize = (iconSize.toFloat() / folderColumnCount) val scaledCellSize = (iconSize.toFloat() / folderColumnCount)
val scaledGap = scaledCellSize / 5f val scaledGap = scaledCellSize / 5f
val scaledIconSize = (iconSize - (folderColumnCount + 1) * scaledGap) / folderColumnCount val scaledIconSize = (iconSize - (folderColumnCount + 1) * scaledGap) / folderColumnCount
val extraYMargin = if (folderRowCount < folderColumnCount) scaledIconSize / 2 else 0f val extraYMargin = if (folderRowCount < folderColumnCount) (scaledIconSize + scaledGap) / 2 else 0f
items.forEach { items.forEach {
val (row, column) = it.getPositionInFolder(this@generateFolderDrawable) val (row, column) = it.getPositionInFolder(this@generateFolderDrawable)
val drawableX = (scaledGap + column * scaledIconSize + column * scaledGap).toInt() val drawableX = (scaledGap + column * scaledIconSize + column * scaledGap).toInt()