Skip to content

Commit

Permalink
fix floating window
Browse files Browse the repository at this point in the history
  • Loading branch information
MOldtime committed Oct 21, 2024
1 parent 4f8040a commit 0e5c005
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ class Composition(
private val movableRange = intArrayOf(0, 0)

private val keyTextSizeSpan by lazy { AbsoluteSizeSpan(sp(keyTextSize)) }
private val labelTextSizeSpan by lazy { AbsoluteSizeSpan(sp(labelTextSize)) }
private val candidateTextSizeSpan by lazy { AbsoluteSizeSpan(sp(candidateTextSize)) }
private val commentTextSizeSpan by lazy { AbsoluteSizeSpan(sp(commentTextSize)) }
private val keyTextColorSpan by lazy { keyTextColor?.let { ForegroundColorSpan(it) } }
private val highlightTextColorSpan by lazy { highlightTextColor?.let { ForegroundColorSpan(it) } }
private val highlightBackColorSpan by lazy { highlightBackColor?.let { BackgroundColorSpan(it) } }
Expand Down Expand Up @@ -333,7 +330,7 @@ class Composition(
labelColor,
labelTextSize,
)
inSpans(alignmentSpan, labelSpan, labelTextSizeSpan) { append(label) }
inSpans(alignmentSpan, labelSpan, AbsoluteSizeSpan(sp(labelTextSize))) { append(label) }

val candidateSpan =
CandidateSpan(
Expand All @@ -344,7 +341,7 @@ class Composition(
candidateTextColor,
candidateTextSize,
)
inSpans(alignmentSpan, candidateSpan, candidateTextSizeSpan) { append(text) }
inSpans(alignmentSpan, candidateSpan, AbsoluteSizeSpan(sp(candidateTextSize))) { append(text) }
currentLineLength += text.length

if (showComment && !candidate.comment.isNullOrEmpty()) {
Expand All @@ -358,7 +355,7 @@ class Composition(
commentTextColor,
commentTextSize,
)
inSpans(alignmentSpan, commentSpan, commentTextSizeSpan) { append(comment) }
inSpans(alignmentSpan, commentSpan, AbsoluteSizeSpan(sp(commentTextSize))) { append(comment) }
currentLineLength += comment.length
}
}
Expand Down

0 comments on commit 0e5c005

Please sign in to comment.