Adjust width requirement for big enter (#21470)

This commit is contained in:
Ryan 2023-07-08 00:08:13 +10:00 committed by GitHub
parent 6bdd8e2782
commit ef39ecd1b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 16 deletions

View File

@ -201,7 +201,7 @@
{"matrix": [2, 9], "x": 9.75, "y": 2}, {"matrix": [2, 9], "x": 9.75, "y": 2},
{"matrix": [2, 10], "x": 10.75, "y": 2}, {"matrix": [2, 10], "x": 10.75, "y": 2},
{"matrix": [2, 11], "x": 11.75, "y": 2}, {"matrix": [2, 11], "x": 11.75, "y": 2},
{"matrix": [2, 13], "x": 12.75, "y": 1, "w": 2.25, "h": 2}, {"matrix": [2, 13], "x": 13.5, "y": 1, "w": 1.5, "h": 2},
{"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25}, {"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
{"matrix": [3, 2], "x": 2.25, "y": 3}, {"matrix": [3, 2], "x": 2.25, "y": 3},

View File

@ -116,15 +116,15 @@
{"matrix": [1, 0], "x": 18, "y": 5.9}, {"matrix": [1, 0], "x": 18, "y": 5.9},
{"matrix": [0, 0], "x": 19, "y": 5.9}, {"matrix": [0, 0], "x": 19, "y": 5.9},
{"matrix": [8, 3], "x": 2.25, "y": 7.5, "w": 1.5, "h": 2}, {"matrix": [8, 3], "x": 2.25, "y": 7.5, "w": 1.75, "h": 2},
{"matrix": [8, 4], "x": 3.75, "y": 7.5, "w": 1.5, "h": 2}, {"matrix": [8, 4], "x": 4, "y": 7.5, "w": 1.75, "h": 2},
{"matrix": [8, 5], "x": 5.25, "y": 7.5, "w": 1.5, "h": 2}, {"matrix": [8, 5], "x": 5.75, "y": 7.5, "w": 1.75, "h": 2},
{"matrix": [7, 3], "x": 13.25, "y": 7.5, "w": 1.5, "h": 2}, {"matrix": [7, 3], "x": 12.5, "y": 7.5, "w": 1.75, "h": 2},
{"matrix": [7, 4], "x": 14.75, "y": 7.5, "w": 1.5, "h": 2}, {"matrix": [7, 4], "x": 14.25, "y": 7.5, "w": 1.75, "h": 2},
{"matrix": [7, 5], "x": 16.25, "y": 7.5, "w": 1.5, "h": 2} {"matrix": [7, 5], "x": 16, "y": 7.5, "w": 1.75, "h": 2}
] ]
} }
} }

View File

@ -96,7 +96,7 @@
{"matrix": [2, 10], "x": 10.75, "y": 3.5}, {"matrix": [2, 10], "x": 10.75, "y": 3.5},
{"matrix": [3, 10], "x": 11.75, "y": 3.5}, {"matrix": [3, 10], "x": 11.75, "y": 3.5},
{"matrix": [4, 10], "x": 12.75, "y": 3.5}, {"matrix": [4, 10], "x": 12.75, "y": 3.5},
{"matrix": [5, 10], "x": 13.75, "y": 2.5, "w": 1.5, "h": 2}, {"matrix": [5, 10], "x": 13.75, "y": 2.5, "w": 1.25, "h": 2},
{"matrix": [6, 10], "x": 15.5, "y": 3.5}, {"matrix": [6, 10], "x": 15.5, "y": 3.5},
{"matrix": [7, 10], "x": 16.5, "y": 3.5}, {"matrix": [7, 10], "x": 16.5, "y": 3.5},

View File

@ -182,7 +182,7 @@ def render_layout(layout_data, render_ascii, key_labels=None):
if x >= 0.25 and w == 1.25 and h == 2: if x >= 0.25 and w == 1.25 and h == 2:
render_key_isoenter(textpad, x, y, w, h, label, style) render_key_isoenter(textpad, x, y, w, h, label, style)
elif w == 2.25 and h == 2: elif w == 1.5 and h == 2:
render_key_baenter(textpad, x, y, w, h, label, style) render_key_baenter(textpad, x, y, w, h, label, style)
else: else:
render_key_rect(textpad, x, y, w, h, label, style) render_key_rect(textpad, x, y, w, h, label, style)
@ -275,7 +275,7 @@ def render_key_baenter(textpad, x, y, w, h, label, style):
w = ceil(w * 4) w = ceil(w * 4)
h = ceil(h * 3) h = ceil(h * 3)
label_len = w - 2 label_len = w + 1
label_leftover = label_len - len(label) label_leftover = label_len - len(label)
if len(label) > label_len: if len(label) > label_len:
@ -292,9 +292,9 @@ def render_key_baenter(textpad, x, y, w, h, label, style):
lab_line = array('u', box_chars['v'] + label_middle + box_chars['v']) lab_line = array('u', box_chars['v'] + label_middle + box_chars['v'])
bot_line = array('u', box_chars['bl'] + label_border_bottom + box_chars['br']) bot_line = array('u', box_chars['bl'] + label_border_bottom + box_chars['br'])
textpad[y][x + 3:x + w] = top_line textpad[y][x:x + w] = top_line
textpad[y + 1][x + 3:x + w] = mid_line textpad[y + 1][x:x + w] = mid_line
textpad[y + 2][x + 3:x + w] = mid_line textpad[y + 2][x:x + w] = mid_line
textpad[y + 3][x:x + w] = crn_line textpad[y + 3][x - 3:x + w] = crn_line
textpad[y + 4][x:x + w] = lab_line textpad[y + 4][x - 3:x + w] = lab_line
textpad[y + 5][x:x + w] = bot_line textpad[y + 5][x - 3:x + w] = bot_line