mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-03 13:47:31 +01:00
fix(common-ui): no indentation for first-level comments (#17)
This commit is contained in:
parent
8a6f2ac45f
commit
98da3be105
@ -34,6 +34,9 @@ internal class DefaultThemeRepository : ThemeRepository {
|
||||
startColor: Color,
|
||||
endColor: Color,
|
||||
): Color {
|
||||
if (depth == 0) {
|
||||
return Color.Transparent
|
||||
}
|
||||
val r1 = startColor.red
|
||||
val g1 = startColor.green
|
||||
val b1 = startColor.blue
|
||||
@ -46,7 +49,7 @@ internal class DefaultThemeRepository : ThemeRepository {
|
||||
val greenStep = (g2 - g1) / maxDepth
|
||||
val blueStep = (b2 - b1) / maxDepth
|
||||
|
||||
val index = (depth % maxDepth)
|
||||
val index = ((depth - 1).coerceAtLeast(0) % maxDepth)
|
||||
return Color(
|
||||
r1 + redStep * index,
|
||||
g1 + greenStep * index,
|
||||
|
@ -14,5 +14,5 @@ data class CommentModel(
|
||||
val path: String = "",
|
||||
val children: List<CommentModel>? = null,
|
||||
) : JavaSerializable {
|
||||
val depth: Int get() = (path.split(".").size - 1).coerceAtLeast(0)
|
||||
val depth: Int get() = (path.split(".").size - 2).coerceAtLeast(0)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user