From fb6e6fa721d2acc536774c1930fa4df1488f74f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=91=EC=A3=BC=ED=98=84?= Date: Thu, 17 Oct 2024 02:39:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EB=AC=B4=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=ED=95=9C=20=EC=A4=84=20=EB=8D=94=20=EC=B6=94=EA=B0=80=ED=95=9C?= =?UTF-8?q?=20=ED=81=AC=EA=B8=B0=EB=A1=9C=20=EA=B3=84=EC=82=B0=ED=95=98?= =?UTF-8?q?=EA=B3=A0=20=EC=9E=88=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/logged_in/home/timetable/AdjustedTextLayout.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt index ea2694900..5dc57154e 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt @@ -76,9 +76,11 @@ fun calculateAdjustedTextLayout( if (textMeasurer.measure(allOneLineParagraph).multiParagraph.height > maxHeight) { return cellInfoList.fold(emptyList()) { acc, current -> val paragraph = buildAnnotatedString { - (acc + current).forEach { + (acc + current).forEachIndexed { idx, it -> pushStyle(it.minifiedStyle.toSpanStyle()) - appendLine() + if ((acc + current).lastIndex != idx) { + appendLine() + } } } if (textMeasurer.measure(paragraph).multiParagraph.height < maxHeight) { From 2d151fcc74230b7ade1baaad32a6e440a5621fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=91=EC=A3=BC=ED=98=84?= Date: Thu, 17 Oct 2024 02:39:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=95=88=EC=A0=84=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4=20<=3D=20=EB=8C=80=EC=8B=A0=20<=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/logged_in/home/timetable/AdjustedTextLayout.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt index 5dc57154e..0a57769cf 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/timetable/AdjustedTextLayout.kt @@ -33,7 +33,7 @@ fun calculateAdjustedTextLayout( repeat(idealMaxLines) { appendLine() } } } - if (textMeasurer.measure(fullRenderParagraph).multiParagraph.height <= maxHeight) { + if (textMeasurer.measure(fullRenderParagraph).multiParagraph.height < maxHeight) { return cellInfoList.map { AdjustedTextLayout( it.text, @@ -56,7 +56,7 @@ fun calculateAdjustedTextLayout( repeat(idealMaxLines) { appendLine() } } } - if (textMeasurer.measure(minifiedRenderParagraph).multiParagraph.height <= maxHeight) { + if (textMeasurer.measure(minifiedRenderParagraph).multiParagraph.height < maxHeight) { return cellInfoList.map { AdjustedTextLayout( it.text, @@ -127,7 +127,7 @@ fun calculateAdjustedTextLayout( appendLine() } }, - ).multiParagraph.height <= maxHeight + ).multiParagraph.height < maxHeight ) { currentMaxLines++ // 높이 제약이 없을 때의 라인 수에 도달하면, 더 라인 수를 늘려서 계산해 볼 필요가 없으니 break