Skip to content

Commit

Permalink
Alt hint label: Do not show it if shifted
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Pierre Rasquin <[email protected]>
  • Loading branch information
yank555-lu committed Jan 6, 2019
1 parent 751f0f1 commit 9e943e5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ private void onBufferDraw(Canvas canvas) {

// Draw alternate hint label (if present) behind the main key
String altHint = key.getAltHintLabel(showHints7Bit(), showHintsAll());
if (!altHint.equals("")) {
if (!altHint.equals("") && !key.isShifted()) {
int hintTextSize = (int)(mKeyTextSize * 0.6 * mLabelScale);
paintHint.setTextSize(hintTextSize);

Expand All @@ -1062,7 +1062,8 @@ private void onBufferDraw(Canvas canvas) {
// Draw main key label
final int centerX = Math.round(
(key.width + padding.left - padding.right) / 2
* (altHint.equals("") ? 1f : KEY_LABEL_ALTHINT_HORIZONTAL_ADJUSTMENT_FACTOR));
* (!altHint.equals("") && !key.isShifted()
? KEY_LABEL_ALTHINT_HORIZONTAL_ADJUSTMENT_FACTOR : 1f));
final int centerY = (key.height + padding.top - padding.bottom) / 2;
final float baseline = centerY
+ labelHeight * KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR;
Expand Down

0 comments on commit 9e943e5

Please sign in to comment.