nailed it

This commit is contained in:
Adam Mayer 2017-12-26 23:04:48 -05:00
parent 1a9c639ca8
commit 6455077236

View File

@ -32,7 +32,9 @@ def get_char(ft,off):
def bytecoords(b): def bytecoords(b):
rx, ry = math.floor(b/16), b%16 rx, ry = math.floor(b/16), b%16
ry = 15 - ry # inverted y axis if ry > 8:
ry = ry - 16
ry = 8 - ry # inverted y axis
return ( 50 + rx*16, 50 + ry*16 ) return ( 50 + rx*16, 50 + ry*16 )
def OnDraw(w, cr): def OnDraw(w, cr):
@ -49,10 +51,12 @@ def OnDraw(w, cr):
# move # move
(x,y) = bytecoords( data.pop(0) ) (x,y) = bytecoords( data.pop(0) )
cr.move_to(x,y) cr.move_to(x,y)
elif c == 0x21: elif c > 0x20:
# draw to segments = c - 0x20
(x,y) = bytecoords( data.pop(0) ) for s in range(segments):
cr.line_to(x,y) # draw to
(x,y) = bytecoords( data.pop(0) )
cr.line_to(x,y)
cr.stroke() cr.stroke()
def OnKey(w, event): def OnKey(w, event):