mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 02:17:03 +00:00
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 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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue