File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
app/src/main/java/com/osfans/trime/ime/text Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ protected void onDraw(Canvas canvas) {
228228 if (candidates == null ) return ;
229229 super .onDraw (canvas );
230230
231+ boolean moveAllCandidatesDown = false ;
231232 for (ComputedCandidate computedCandidate : computedCandidates ) {
232233 int i = computedCandidates .indexOf (computedCandidate );
233234 // Draw highlight
@@ -243,11 +244,12 @@ protected void onDraw(Canvas canvas) {
243244 - (candidatePaint .ascent () + candidatePaint .descent ()) / 2 ;
244245 if (shouldShowComment ) {
245246 String comment = ((ComputedCandidate .Word ) computedCandidate ).getComment ();
247+ moveAllCandidatesDown |= comment != null && !comment .isEmpty ();
248+ if (moveAllCandidatesDown ) wordY += commentHeight / 2.0f ;
246249 if (comment != null && !comment .isEmpty ()) {
247250 float commentX = computedCandidate .getGeometry ().centerX ();
248251 float commentY =
249252 commentHeight / 2.0f - (commentPaint .ascent () + commentPaint .descent ()) / 2 ;
250- wordY += commentHeight / 2.0f ;
251253 if (!isCommentOnTop ) {
252254 float commentWidth = GraphicUtils .measureText (commentPaint , comment , commentFont );
253255 commentX = computedCandidate .getGeometry ().right - commentWidth / 2 ;
You can’t perform that action at this time.
0 commit comments