Fix __str__() function for linesegment
This commit is contained in:
@@ -58,7 +58,7 @@ class LineSegment:
|
|||||||
return max(self.__startpoint.get_y(), self.__endpoint.get_y())
|
return max(self.__startpoint.get_y(), self.__endpoint.get_y())
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""Return the line segment values as string."""
|
"""Return the line segment values as string."""
|
||||||
return self.__startpoint.str() + "-->" + self.__endpoint.str()
|
return str(self.__startpoint) + "-->" + str(self.__endpoint)
|
||||||
def draw(self, canvas, width, height, max_x, max_y, color="#000000"):
|
def draw(self, canvas, width, height, max_x, max_y, color="#000000"):
|
||||||
"""Draw the line segment in a canvas."""
|
"""Draw the line segment in a canvas."""
|
||||||
from_x, from_y = self.__startpoint.draw(canvas, width, height, max_x, max_y, color)
|
from_x, from_y = self.__startpoint.draw(canvas, width, height, max_x, max_y, color)
|
||||||
|
|||||||
Reference in New Issue
Block a user