diff --git a/components/drawable.py b/components/drawable.py index d4a26ae..a20760e 100644 --- a/components/drawable.py +++ b/components/drawable.py @@ -10,11 +10,14 @@ class Drawable(object): or `draw_unchanging`. """ - def __init__(self, draw_offset, height_limit=None, width_limit=None): + def __init__(self, draw_offset, width_limit=None, height_limit=None): """ draw_offset is a (width, height) tuple. """ self.draw_offset = draw_offset if draw_offset else (0, 0) + # TODO Make the semantics like so: if width_limit is None, make it scale + # along the screen's width; if height_limit is None, make it scale along + # the screen's height. self.max_size = (width_limit, height_limit) if width_limit and height_limit else None def draw(self, window, screen, **kwargs): diff --git a/components/helpers/grid.py b/components/helpers/grid.py index 9a64757..2394193 100644 --- a/components/helpers/grid.py +++ b/components/helpers/grid.py @@ -30,8 +30,8 @@ class Grid(Drawable): A grid must be drawable (and traversable)! """ - def __init__(self, draw_width=-1, draw_height=-1, draw_offset=None): - super(Grid, self).__init__(draw_offset) + def __init__(self, draw_offset=None, width_limit=None, height_limit=None): + super(Grid, self).__init__(draw_offset, width_limit, height_limit) def traverse(self): """ diff --git a/components/shapes.py b/components/shapes.py index 3f12ff6..8b51a7c 100644 --- a/components/shapes.py +++ b/components/shapes.py @@ -34,7 +34,7 @@ class PointShape(Drawable): @author Chad Estioco """ - def __init__(self, point_list = None, line_color = Colors.MAX_BLACK, draw_offset=None): + def __init__(self, point_list=None, line_color=Colors.MAX_BLACK, draw_offset=None): """ Create a PointShape with the given point_list. """