mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 05:29:26 +02:00
customdrawn-android: Improves the drawing of the bottom part of letters like g
git-svn-id: trunk@34152 -
This commit is contained in:
parent
f45d3703b2
commit
50dc7cf2e8
@ -87,7 +87,7 @@ public class LCLActivity extends Activity
|
||||
// Don't use just localbounds.height() from the source text
|
||||
// because it will calculate the minimum necessary height,
|
||||
// but we can't easily use that to draw text because it draws relative to the baseline
|
||||
localpaint.getTextBounds("Íq", 0, 2, localbounds);
|
||||
localpaint.getTextBounds("Íqg", 0, 3, localbounds);
|
||||
lclheight = localbounds.height();
|
||||
// Also get some measures
|
||||
lcltextascent = (int) localpaint.getFontMetrics().ascent;
|
||||
@ -110,7 +110,7 @@ public class LCLActivity extends Activity
|
||||
localcanvas.drawColor(Color.TRANSPARENT); // TRANSPARENT
|
||||
// The Y coordinate is the lower baseline of letters like "abc"
|
||||
// see http://code.google.com/p/android/issues/detail?id=393
|
||||
localcanvas.drawText(lcltext, 0, lclheight - lcltextdescent, localpaint);
|
||||
localcanvas.drawText(lcltext, 0, lclheight - lcltextbottom, localpaint);
|
||||
}
|
||||
|
||||
// LCLType definitions
|
||||
|
@ -4215,7 +4215,7 @@ begin
|
||||
lAverageCharWidth := javaEnvRef^^.GetIntField(javaEnvRef, javaActivityObject, javaField_lclwidth);
|
||||
|
||||
// Prepare the input for getting the max height of a text and other metrics
|
||||
lJavaString :=javaEnvRef^^.NewStringUTF(javaEnvRef, PChar('Íą'));
|
||||
lJavaString :=javaEnvRef^^.NewStringUTF(javaEnvRef, PChar('Íg'));
|
||||
javaEnvRef^^.SetObjectField(javaEnvRef, javaActivityObject, JavaField_lcltext, lJavaString);
|
||||
javaEnvRef^^.SetIntField(javaEnvRef, javaActivityObject, javaField_lcltextsize, DefaultFontAndroidSize);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user