forked from extern/Unexpected-Keyboard
Don't cap indication length
This was inadvertently changed when the anti-circle gesture was introduced, which use the same rendering logic.
This commit is contained in:
parent
c5e9e3ff5c
commit
6ac973cfda
@ -460,15 +460,19 @@ public class Keyboard2View extends View
|
|||||||
{
|
{
|
||||||
boolean special_font = false;
|
boolean special_font = false;
|
||||||
String indic;
|
String indic;
|
||||||
|
int indic_length;
|
||||||
float text_size;
|
float text_size;
|
||||||
if (k.indication != null)
|
if (k.indication != null)
|
||||||
{
|
{
|
||||||
indic = k.indication;
|
indic = k.indication;
|
||||||
|
indic_length = indic.length();
|
||||||
text_size = keyH * _config.sublabelTextSize * _config.characterSize;
|
text_size = keyH * _config.sublabelTextSize * _config.characterSize;
|
||||||
}
|
}
|
||||||
else if (k.anticircle != null)
|
else if (k.anticircle != null)
|
||||||
{
|
{
|
||||||
indic = k.anticircle.getString();
|
indic = k.anticircle.getString();
|
||||||
|
// 3 character limit like regular labels
|
||||||
|
indic_length = Math.min(indic.length(), 3);
|
||||||
special_font = k.anticircle.hasFlagsAny(KeyValue.FLAG_KEY_FONT);
|
special_font = k.anticircle.hasFlagsAny(KeyValue.FLAG_KEY_FONT);
|
||||||
text_size = scaleTextSize(k.anticircle, _config.sublabelTextSize, keyH);
|
text_size = scaleTextSize(k.anticircle, _config.sublabelTextSize, keyH);
|
||||||
}
|
}
|
||||||
@ -479,8 +483,7 @@ public class Keyboard2View extends View
|
|||||||
Paint p = _theme.indicationPaint(special_font);
|
Paint p = _theme.indicationPaint(special_font);
|
||||||
p.setColor(_theme.subLabelColor);
|
p.setColor(_theme.subLabelColor);
|
||||||
p.setTextSize(text_size);
|
p.setTextSize(text_size);
|
||||||
// Limit indication length to 3 characters
|
canvas.drawText(indic, 0, indic_length,
|
||||||
canvas.drawText(indic, 0, Math.min(indic.length(), 3),
|
|
||||||
x + keyW / 2f, (keyH - p.ascent() - p.descent()) * 4/5 + y, p);
|
x + keyW / 2f, (keyH - p.ascent() - p.descent()) * 4/5 + y, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user