Merge branch 'fix_line_drawing' of https://github.com/Luflosi/kitty

This commit is contained in:
Kovid Goyal 2019-10-19 06:26:57 +05:30
commit 033367de91
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -238,9 +238,13 @@ def antialiased_1px_line(buf, width, height, p1, p2):
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))