Browse Source

* send full x/y ansi position information in case of an X-coordinate
overflow (don't know what the y-coordinate is at that point, because the
window may be wider than the artificial screenwidth) (mantis #20880)

git-svn-id: trunk@21925 -

Jonas Maebe 13 years ago
parent
commit
6cc78635d7
3 changed files with 26 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 4 1
      rtl/unix/crt.pp
  3. 21 0
      tests/webtbs/tw20880.pp

+ 1 - 0
.gitattributes

@@ -12602,6 +12602,7 @@ tests/webtbs/tw20872c.pp svneol=native#text/pascal
 tests/webtbs/tw20873.pp svneol=native#text/plain
 tests/webtbs/tw20873.pp svneol=native#text/plain
 tests/webtbs/tw20874a.pp svneol=native#text/pascal
 tests/webtbs/tw20874a.pp svneol=native#text/pascal
 tests/webtbs/tw20874b.pp svneol=native#text/pascal
 tests/webtbs/tw20874b.pp svneol=native#text/pascal
+tests/webtbs/tw20880.pp -text svneol=native#text/plain
 tests/webtbs/tw20889.pp svneol=native#text/pascal
 tests/webtbs/tw20889.pp svneol=native#text/pascal
 tests/webtbs/tw20909.pp svneol=native#text/pascal
 tests/webtbs/tw20909.pp svneol=native#text/pascal
 tests/webtbs/tw20940.pp svneol=native#text/pascal
 tests/webtbs/tw20940.pp svneol=native#text/pascal

+ 4 - 1
rtl/unix/crt.pp

@@ -112,7 +112,10 @@ Function XY2Ansi(x,y,ox,oy:longint):String;
   Returns a string with the escape sequences to go to X,Y on the screen
   Returns a string with the escape sequences to go to X,Y on the screen
 }
 }
 Begin
 Begin
-  if y=oy then
+  { in case of potential ox overflow, send full position information
+    (mantis #20880) }
+  if (y=oy) and
+     (ox<>$ff) then
    begin
    begin
      if x=ox then
      if x=ox then
       begin
       begin

+ 21 - 0
tests/webtbs/tw20880.pp

@@ -0,0 +1,21 @@
+{ %interactive }
+
+program CrtBug;
+
+uses Crt;
+
+begin
+  ClrScr;
+  Window(windmaxx - 25, 5, windmaxx, 20);
+  TextColor(LightRed);
+  TextBackground(Cyan); 
+  ClrScr;  
+  
+  while not KeyPressed do
+  begin
+    Write('R=', Random(256), ' ');
+    Delay(100);
+  end;
+  
+  ReadKey;
+end.