Fix excess redraws
authorKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 14 Mar 2015 02:46:19 +0000 (22:46 -0400)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 14 Mar 2015 02:46:19 +0000 (22:46 -0400)
src/jexer/io/ECMA48Screen.java
src/jexer/io/ECMA48Terminal.java

index 15dee5019a49e9bd1d8aaadd9af1f2f160980df9..659d132a96190131f64c3e1926b4c0559bae4abf 100644 (file)
@@ -91,7 +91,7 @@ public class ECMA48Screen extends Screen {
             Cell lCell = logical[x][y];
             Cell pCell = physical[x][y];
 
-            if ((lCell != pCell) || reallyCleared) {
+            if (!lCell.equals(pCell) || reallyCleared) {
 
                 if (debugToStderr) {
                     System.err.printf("\n--\n");
@@ -222,10 +222,10 @@ public class ECMA48Screen extends Screen {
                 lastX = x;
                 lastAttr.setTo(lCell);
 
-                // Physical is always updatesd
+                // Physical is always updated
                 physical[x][y].setTo(lCell);
 
-            } // if ((lCell != pCell) || (reallyCleared == true))
+            } // if (!lCell.equals(pCell) || (reallyCleared == true))
 
         } // for (int x = 0; x < width; x++)
     }
index 064c4ec99f98b7d85963adc1429316751bcb4601..b608a69f832862c76719201d02d5b33758b9ea5d 100644 (file)
@@ -1445,8 +1445,8 @@ public class ECMA48Terminal implements Runnable {
                         }
                     }
                 } else {
-                    // Wait 5 millis for more data
-                    Thread.sleep(5);
+                    // Wait 10 millis for more data
+                    Thread.sleep(10);
                 }
                 // System.err.println("end while loop"); System.err.flush();
             } catch (InterruptedException e) {