Merge branch 'fix_line_drawing' of https://github.com/Luflosi/kitty
This commit is contained in:
commit
033367de91
1 changed files with 5 additions and 1 deletions
|
|
@ -238,9 +238,13 @@ def draw_endpoint(pt):
|
|||
grad = dy/dx
|
||||
intery = y1 + rfpart(x1) * grad
|
||||
|
||||
xstart = draw_endpoint(p(*p1)) + 1
|
||||
xstart = draw_endpoint(p(*p1))
|
||||
xend = draw_endpoint(p(*p2))
|
||||
|
||||
if xstart > xend:
|
||||
xstart, xend = xend, xstart
|
||||
xstart += 1
|
||||
|
||||
for x in range(xstart, xend):
|
||||
y = int(intery)
|
||||
putpixel(p(x, y), rfpart(intery))
|
||||
|
|
|
|||
Loading…
Reference in a new issue