Skip to content

Commit

Permalink
Increase minimum width of candidate from 0.5 to 0.7 times of height
Browse files Browse the repository at this point in the history
  • Loading branch information
tamo committed Feb 12, 2025
1 parent b4226eb commit 93e3540
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/jp/deadend/noname/skk/CandidateView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs
var lineW = 0
var totalLineW = 0
mTotalWidth = mSuggestions.map { suggestion ->
mPaint.measureText(suggestion).toInt().coerceAtLeast(mLineHeight / 2) + X_GAP * 2
mPaint.measureText(suggestion).coerceAtLeast(mLineHeight * 0.7f) + X_GAP * 2
}.foldIndexed(0) { i, _, wordWidth ->
// 改行
if (lineW != 0 && lineW + wordWidth > width) {
Expand All @@ -283,10 +283,10 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs
}

// 登録
mWordWidth[i] = wordWidth
mWordWidth[i] = wordWidth.toInt()
mWordX[i] = lineX + lineW
mWordL[i] = lineN
lineW += wordWidth
lineW += wordWidth.toInt()
totalLineW = lineW.coerceAtLeast(totalLineW)
lineX + totalLineW
}
Expand Down

0 comments on commit 93e3540

Please sign in to comment.