Skip to content

Commit

Permalink
#30 colour invalid binds
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbuckle committed Nov 17, 2018
1 parent 3493ba6 commit c4e61cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions www/scripts/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,6 @@ def fontSizeForKeyBoardItems(physicalKeys):

# Write text, possible wrapping
def writeText(context, img, text, screenState, font, surround, newLine):
if text is None:
text = "hell"
#return
border = 4

# Work out the size of the text
Expand All @@ -323,6 +320,10 @@ def writeText(context, img, text, screenState, font, surround, newLine):
context.fill_color=Color('#000')
context.fill_opacity=1

if text is None:
text = 'invalid'
context.fill_color=Color('#FFFF7F50') # Coral

metrics = context.get_font_metrics(img, text, multiline=False)
if screenState['currentY'] + int(metrics.text_height + 32) > 2160:
# Gone off the bottom of the page; go to next column
Expand Down

0 comments on commit c4e61cb

Please sign in to comment.