Skip to content

Commit

Permalink
Fix artifacts and crashes on moving dialogs (from anta999)
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Oct 29, 2024
1 parent aabbde9 commit f205390
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion far/src/console/interf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,22 @@ void Text(const WCHAR Ch, uint64_t Color, size_t Length)
if ( !Length )
return;

ScrBuf.FillRect(CurX, CurY, CurX + Length, CurY, Ch, Color);
int X1 = CurX;
int Y1 = CurY;
int X2 = CurX + Length;
int Y2 = CurY;

if (X1 < 0)
X1 = 0;
if (Y1 < 0)
Y1 = 0;

if (X2 > ScrX)
X2 = ScrX;
if (Y2 > ScrY)
Y2 = ScrY;

ScrBuf.FillRect(X1, Y1, X2, Y2, Ch, Color);
CurX += Length;
}

Expand Down

0 comments on commit f205390

Please sign in to comment.