Skip to content

Commit

Permalink
Improving Canvas documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
CRImier committed Mar 11, 2018
1 parent 4c71538 commit 67e8899
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/ui/canvas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Canvas

.. autoclass:: Canvas
:show-inheritance:
:members: __init__,get_image,get_center,invert,width,height,size,image,background_color,default_color,text,rectangle,invert_rect_colors,check_coordinates,clear
:members: point,line,text,rectangle,display,load_font,get_image,get_center,invert,width,height,size,image,background_color,default_color,invert_rect_colors,check_coordinates,clear
13 changes: 6 additions & 7 deletions ui/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class Canvas(object):
This object allows you to work with graphics on the display quicker and easier.
You can draw text, graphical primitives, insert bitmaps and do other things
that the ``PIL`` library allows, with a bunch of useful helper functions.
Args:
* ``o``: output device
* ``base_image``: a `PIL.Image` to use as a base, if needed
* ``name``: a name, for internal usage
"""

height = 0 #: height of canvas in pixels.
Expand All @@ -27,13 +33,6 @@ class Canvas(object):
default_font = default_font #: default font, referenced here to avoid loading it every time

def __init__(self, o, base_image=None, name=""):
"""
Args:
* ``o``: output device
* ``base_image``: an image to use as a base
* ``name``: a name, for internal usage
"""
self.o = o
if "b&w-pixel" not in o.type:
raise ValueError("The output device supplied doesn't support pixel graphics!")
Expand Down

0 comments on commit 67e8899

Please sign in to comment.