Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
python-ev3dev2 (2.0.0~beta3) stable; urgency=medium

[Daniel Walton]
* Display: correct xy variable names passed to Display.rectangle()
* GyroSensor wait_until_angle_changed_by added direction_sensitive option
* Added MoveDifferential
* Sound: removed play() in favor of play_file()
Expand Down
7 changes: 4 additions & 3 deletions ev3dev2/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,16 @@ def circle(self, clear_screen=True, x=50, y=50, radius=40, fill_color='black', o

return self.draw.ellipse((x1, y1, x2, y2), fill=fill_color, outline=outline_color)

def rectangle(self, clear_screen=True, x=10, y=10, width=80, height=40, fill_color='black', outline_color='black'):
def rectangle(self, clear_screen=True, x1=10, y1=10, x2=80, y2=40, fill_color='black', outline_color='black'):
"""
Draw a rectangle 'width x height' where the top left corner is at (x, y)
Draw a rectangle where the top left corner is at (x1, y1) and the
bottom right corner is at (x2, y2)
"""

if clear_screen:
self.clear()

return self.draw.rectangle((x, y, width, height), fill=fill_color, outline=outline_color)
return self.draw.rectangle((x1, y1, x2, y2), fill=fill_color, outline=outline_color)

def point(self, clear_screen=True, x=10, y=10, point_color='black'):
"""
Expand Down