Fix __str__() function for linesegment

This commit is contained in:
2020-03-22 18:40:14 +01:00
parent 55be8b1c68
commit a348c9c035

View File

@@ -58,7 +58,7 @@ class LineSegment:
return max(self.__startpoint.get_y(), self.__endpoint.get_y())
def __str__(self):
"""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"):
"""Draw the line segment in a canvas."""
from_x, from_y = self.__startpoint.draw(canvas, width, height, max_x, max_y, color)