Android Question Canvas: center text vertically

LucaMs

Expert
Licensed User
Longtime User
I use this to calculate the Y coordinate of a text to draw on a panel using a canvas, but it does not work well.

B4X:
Y_CnvText = (Panel1.Height + cnv.MeasureStringHeight(mText, mTypeFace1, mTextSize)) /2
 
Top