Skip to content

Commit 47f1074

Browse files
authored
Display: correct xy variable names passed to Display.rectangle() (#557)
Resolves issue #533
1 parent 21205ea commit 47f1074

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎debian/changelog‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
python-ev3dev2 (2.0.0~beta3) stable; urgency=medium
22

3+
[Daniel Walton]
4+
* Display: correct xy variable names passed to Display.rectangle()
35
* GyroSensor wait_until_angle_changed_by added direction_sensitive option
46
* Added MoveDifferential
57
* Sound: removed play() in favor of play_file()

‎ev3dev2/display.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,16 @@ def circle(self, clear_screen=True, x=50, y=50, radius=40, fill_color='black', o
339339

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

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

347348
if clear_screen:
348349
self.clear()
349350

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

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

0 commit comments

Comments
 (0)