# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1620773609 0 # Node ID 1b3b40c89cd0cabcb2be9939b6801af5cdb6c81f # Parent cd9d2ba251d5b9e50bdda7ba951f55f204390008 Android: Move the text to below the point, not above it. Adjust the rect and origin based on the calculated text height. diff -r cd9d2ba251d5 -r 1b3b40c89cd0 android/DWindows.kt --- a/android/DWindows.kt Tue May 11 22:44:45 2021 +0000 +++ b/android/DWindows.kt Tue May 11 22:53:29 2021 +0000 @@ -1937,15 +1937,16 @@ paint.style = Paint.Style.FILL_AND_STROKE paint.textAlign = Paint.Align.LEFT paint.getTextBounds(text, 0, text.length, rect) - rect.top += y - rect.bottom += y + val textheight = rect.bottom - rect.top + rect.top += y + textheight + rect.bottom += y + textheight rect.left += x rect.right += x canvas.drawRect(rect, paint) // Restore the color and prepare to draw text paint.color = oldcolor paint.style = Paint.Style.STROKE - canvas.drawText(text, x.toFloat(), y.toFloat(), paint) + canvas.drawText(text, x.toFloat(), y.toFloat() + textheight.toFloat(), paint) } } }