Screen bleed fix under rare circumstance

This commit is contained in:
mysticbbs 2012-06-18 08:58:35 -04:00
parent f8b8244ab1
commit c7bc65c4a8
2 changed files with 45 additions and 16 deletions

View File

@ -52,6 +52,7 @@ Type
Procedure ClearScreen; Virtual;
Procedure ScrollWindow; Virtual;
Procedure ClearEOL;
Procedure CursorXYRaw (X, Y: Byte);
Procedure CursorXY (X, Y: Byte);
Procedure SetWindow (X1, Y1, X2, Y2: Byte; Home: Boolean);
Procedure SetScreenSize (Mode: Byte);
@ -214,11 +215,24 @@ Begin
FTextAttr := Attr;
End;
Procedure TOutputDarwin.CursorXYRaw (X, Y: Byte);
Begin
If (Y < 1) Then Y := 1 Else
If (Y > ScreenSize) Then Y := ScreenSize;
If (X < 1) Then X := 1 Else
If (X > 80) Then X := 80;
BufAddStr(#27 + '[' + strI2S(Y) + ';' + strI2S(X) + 'H');
BufFlush;
FCursorX := X;
FCursorY := Y;
End;
Procedure TOutputDarwin.CursorXY (X, Y: Byte);
Begin
If (Y < 1) Then Y := 1 Else
// If (Y > FWinBot) Then Y := FWinBot; {changed 109a4}
If (Y > ScreenSize) Then Y := ScreenSize;
If (Y > FWinBot) Then Y := FWinBot; {changed 109a4}
If (X < 1) Then X := 1 Else
If (X > 80) Then X := 80;
@ -452,7 +466,7 @@ Begin
OldX := FCursorX;
OldY := FCursorY;
CursorXY (X, Y);
CursorXYRaw (X, Y);
SetTextAttr (A);
For Count := 1 to Length(Text) Do
@ -467,7 +481,7 @@ Begin
Break;
SetTextAttr (OldAttr);
CursorXY (OldX, OldY);
CursorXYRaw (OldX, OldY);
BufFlush;
End;
@ -498,7 +512,7 @@ Begin
OldX := FCursorX;
OldY := FCursorY;
CursorXY (X, Y);
CursorXYRaw (X, Y);
SetTextAttr (Attr);
Count := 1;
@ -534,7 +548,7 @@ Begin
End;
SetTextAttr (OldAttr);
CursorXY (OldX, OldY);
CursorXYRaw (OldX, OldY);
BufFlush;
End;

View File

@ -52,6 +52,7 @@ Type
Procedure ClearScreen; Virtual;
Procedure ScrollWindow; Virtual;
Procedure ClearEOL;
Procedure CursorXYRaw (X, Y: Byte);
Procedure CursorXY (X, Y: Byte);
Procedure SetWindow (X1, Y1, X2, Y2: Byte; Home: Boolean);
Procedure SetScreenSize (Mode: Byte);
@ -214,11 +215,25 @@ Begin
FTextAttr := Attr;
End;
Procedure TOutputLinux.CursorXYRaw (X, Y: Byte);
Begin
If (Y < 1) Then Y := 1 Else
If (Y > ScreenSize) Then Y := ScreenSize;
If (X < 1) Then X := 1 Else
If (X > 80) Then X := 80;
BufAddStr(#27 + '[' + strI2S(Y) + ';' + strI2S(X) + 'H');
BufFlush;
FCursorX := X;
FCursorY := Y;
End;
Procedure TOutputLinux.CursorXY (X, Y: Byte);
Begin
If (Y < 1) Then Y := 1 Else
// If (Y > FWinBot) Then Y := FWinBot; {changed 109a4}
If (Y > ScreenSize) Then Y := ScreenSize;
If (Y > FWinBot) Then Y := FWinBot; {changed 109a4}
// If (Y > ScreenSize) Then Y := ScreenSize;
If (X < 1) Then X := 1 Else
If (X > 80) Then X := 80;
@ -452,7 +467,7 @@ Begin
OldX := FCursorX;
OldY := FCursorY;
CursorXY (X, Y);
CursorXYRaw (X, Y);
SetTextAttr (A);
For Count := 1 to Length(Text) Do
@ -467,7 +482,7 @@ Begin
Break;
SetTextAttr (OldAttr);
CursorXY (OldX, OldY);
CursorXYRaw (OldX, OldY);
BufFlush;
End;
@ -498,7 +513,7 @@ Begin
OldX := FCursorX;
OldY := FCursorY;
CursorXY (X, Y);
CursorXYRaw (X, Y);
SetTextAttr (Attr);
Count := 1;
@ -534,7 +549,7 @@ Begin
End;
SetTextAttr (OldAttr);
CursorXY (OldX, OldY);
CursorXYRaw (OldX, OldY);
BufFlush;
End;