@@ -104,21 +104,21 @@ def line(self, x0, y0, x1, y1, char): # noqa: C901, PLR0912
104104 if dx == 0 :
105105 y = y0
106106 else :
107- y = y0 + int ( round ((x - x0 ) * dy / float (dx ) ))
107+ y = y0 + round ((x - x0 ) * dy / float (dx ))
108108 self .point (x , y , char )
109109 elif y0 < y1 :
110110 for y in range (y0 , y1 + 1 ):
111111 if dy == 0 :
112112 x = x0
113113 else :
114- x = x0 + int ( round ((y - y0 ) * dx / float (dy ) ))
114+ x = x0 + round ((y - y0 ) * dx / float (dy ))
115115 self .point (x , y , char )
116116 else :
117117 for y in range (y1 , y0 + 1 ):
118118 if dy == 0 :
119119 x = x0
120120 else :
121- x = x1 + int ( round ((y - y1 ) * dx / float (dy ) ))
121+ x = x1 + round ((y - y1 ) * dx / float (dy ))
122122 self .point (x , y , char )
123123
124124 def text (self , x , y , text ):
@@ -258,8 +258,8 @@ def draw(vertices, edges):
258258 maxx = max (Xs )
259259 maxy = max (Ys )
260260
261- canvas_cols = int ( math .ceil (math .ceil (maxx ) - math .floor (minx ) )) + 1
262- canvas_lines = int ( round (maxy - miny ) )
261+ canvas_cols = math .ceil (math .ceil (maxx ) - math .floor (minx )) + 1
262+ canvas_lines = round (maxy - miny )
263263
264264 canvas = AsciiCanvas (canvas_cols , canvas_lines )
265265
@@ -270,10 +270,10 @@ def draw(vertices, edges):
270270 start = edge .view ._pts [index - 1 ]
271271 end = edge .view ._pts [index ]
272272
273- start_x = int ( round (start [0 ] - minx ) )
274- start_y = int ( round (start [1 ] - miny ) )
275- end_x = int ( round (end [0 ] - minx ) )
276- end_y = int ( round (end [1 ] - miny ) )
273+ start_x = round (start [0 ] - minx )
274+ start_y = round (start [1 ] - miny )
275+ end_x = round (end [0 ] - minx )
276+ end_y = round (end [1 ] - miny )
277277
278278 assert start_x >= 0
279279 assert start_y >= 0
@@ -288,12 +288,12 @@ def draw(vertices, edges):
288288 y = vertex .view .xy [1 ]
289289
290290 canvas .box (
291- int ( round (x - minx ) ),
292- int ( round (y - miny ) ),
291+ round (x - minx ),
292+ round (y - miny ),
293293 vertex .view .w ,
294294 vertex .view .h ,
295295 )
296296
297- canvas .text (int ( round (x - minx )) + 1 , int ( round (y - miny ) ) + 1 , vertex .data )
297+ canvas .text (round (x - minx ) + 1 , round (y - miny ) + 1 , vertex .data )
298298
299299 return canvas .draw ()
0 commit comments