Skip to content

Commit

Permalink
After Bill Gray: "touchoverlap() un-touches parts of lines (Issue #149)"
Browse files Browse the repository at this point in the history
  • Loading branch information
wmcbrine committed Jul 12, 2023
1 parent de6c548 commit 5c62af0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pdcurses/touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ int touchoverlap(const WINDOW *win1, WINDOW *win2)

for (y = starty; y < endy; y++)
{
win2->_firstch[y] = startx;
win2->_lastch[y] = endx;
int first = win2->_firstch[y];

if (first == _NO_CHANGE || win2->_lastch[y] < endx)
win2->_lastch[y] = endx;
if (first == _NO_CHANGE || first > startx)
win2->_firstch[y] = startx;
}

return OK;
Expand Down

0 comments on commit 5c62af0

Please # to comment.