Skip to content

Commit

Permalink
another bug fix in draw
Browse files Browse the repository at this point in the history
  • Loading branch information
TabulateJarl8 committed Jul 18, 2021
1 parent 32dce4f commit d5ee5b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ti842py/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__title__ = "ti842py"
__description__ = "TI-BASIC to Python 3 Transpiler"
__url__ = "https://github.com/TabulateJarl8/ti842py"
__version__ = "0.8.4"
__version__ = "0.8.5"
__author__ = "Tabulate"
__author_email__ = "[email protected]"
__license__ = "GPLv3"
Expand Down
2 changes: 1 addition & 1 deletion ti842py/tiParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def convertLine(self, index, line):
# Background On
elif line.startswith('BackgroundOn '):
statement = line.replace('BackgroundOn ', 'draw.backgroundOn(')
statement = statement.split('(')[0] + '("' + statement.split('(')[1] + '")'
statement = statement.split('(')[0] + '(' + statement.split('(')[1] + ')'
self.UTILS['draw']['enabled'] = True

# ClrDraw
Expand Down
7 changes: 2 additions & 5 deletions ti842py/utils/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ def graphCoordsToPixels(self, x, y, minX=-10, maxX=10, minY=-10, maxY=10):
return horiz, vertical

def tiColorToGraphicsColor(self, color, isBackground=False):
if color not in range(1, 25):
raise InvalidColorError(f'The specified color value "{color}" was not in range 1-24')
color = str(color)
original_color = color

if color.find('-') != -1: # negative numbers
raise InvalidColorError(f'The specified color value "{original_color}" was not in range 1-24')
color = re.sub(r'(\d+)', lambda m: self.colors.get(m.group(), '[ERR:DOMAIN]'), color)
if '[ERR:DOMAIN]' in color:
raise InvalidColorError(f'The specified color value "{original_color}" was not in range 1-24')

return color

Expand Down

0 comments on commit d5ee5b9

Please sign in to comment.