Skip to content

Commit 7cb932c

Browse files
MOldtimeWhiredPlanck
authored andcommitted
fix floating window
1 parent 15f74ff commit 7cb932c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/src/main/java/com/osfans/trime/ime/composition/Composition.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ class Composition(
8383
private val movableRange = intArrayOf(0, 0)
8484

8585
private val keyTextSizeSpan by lazy { AbsoluteSizeSpan(sp(keyTextSize)) }
86-
private val labelTextSizeSpan by lazy { AbsoluteSizeSpan(sp(labelTextSize)) }
87-
private val candidateTextSizeSpan by lazy { AbsoluteSizeSpan(sp(candidateTextSize)) }
88-
private val commentTextSizeSpan by lazy { AbsoluteSizeSpan(sp(commentTextSize)) }
8986
private val keyTextColorSpan by lazy { keyTextColor?.let { ForegroundColorSpan(it) } }
9087
private val highlightTextColorSpan by lazy { highlightTextColor?.let { ForegroundColorSpan(it) } }
9188
private val highlightBackColorSpan by lazy { highlightBackColor?.let { BackgroundColorSpan(it) } }
@@ -333,7 +330,7 @@ class Composition(
333330
labelColor,
334331
labelTextSize,
335332
)
336-
inSpans(alignmentSpan, labelSpan, labelTextSizeSpan) { append(label) }
333+
inSpans(alignmentSpan, labelSpan, AbsoluteSizeSpan(sp(labelTextSize))) { append(label) }
337334

338335
val candidateSpan =
339336
CandidateSpan(
@@ -344,7 +341,7 @@ class Composition(
344341
candidateTextColor,
345342
candidateTextSize,
346343
)
347-
inSpans(alignmentSpan, candidateSpan, candidateTextSizeSpan) { append(text) }
344+
inSpans(alignmentSpan, candidateSpan, AbsoluteSizeSpan(sp(candidateTextSize))) { append(text) }
348345
currentLineLength += text.length
349346

350347
if (showComment && !candidate.comment.isNullOrEmpty()) {
@@ -358,7 +355,7 @@ class Composition(
358355
commentTextColor,
359356
commentTextSize,
360357
)
361-
inSpans(alignmentSpan, commentSpan, commentTextSizeSpan) { append(comment) }
358+
inSpans(alignmentSpan, commentSpan, AbsoluteSizeSpan(sp(commentTextSize))) { append(comment) }
362359
currentLineLength += comment.length
363360
}
364361
}

0 commit comments

Comments
 (0)