Skip to content

Commit ac3457d

Browse files
author
farfromrefuge
committed
chore(android): fix when no maxHeight is passed
1 parent 027e2fe commit ac3457d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ui-canvas/platforms/android/java/com/akylas/canvas/StaticLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static android.text.StaticLayout createEllipsizeStaticLayout(android.text
6666
int i = 0;
6767
float lineHeight = staticLayout.getLineBottom(i) - staticLayout.getLineTop(i);
6868
float totalHeight = lineHeight * lineCount;
69-
if (maxLines > 1) {
69+
if (maxHeight > 0 && maxLines > 1) {
7070
while (totalHeight > maxHeight && maxLines > 1) {
7171
maxLines--;
7272
i++;

0 commit comments

Comments
 (0)