mirror of
https://github.com/phooky/Apple-410.git
synced 2024-06-10 02:29:34 +00:00
nailed it
This commit is contained in:
parent
1a9c639ca8
commit
6455077236
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user