changeset 592:415fd7dd09f0

fix phase 1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 13 Feb 2020 07:50:33 +0900
parents 665d58cc7f1a
children 32c104c11767
files src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java	Thu Feb 13 07:25:30 2020 +0900
+++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java	Thu Feb 13 07:50:33 2020 +0900
@@ -169,7 +169,10 @@
 					prevoffset = flushOffset+bytesRead;
 					assert(prevoffset==offset);
 					System.out.println("od prevOffset = "+prevoffset+" span = "+(prevoffset-flushOffset));
-					if (c0rect!=null) { flushRectangle(c0rect); moveNext(); } // finish pahse 1
+					if (c0rect!=null) { // finish pahse 1
+						flushRectangle(c0rect);
+						moveNext();
+					}
 					flushRectangle(c1rect); // phase 2
 					flushMuticast(rfb, bytes);
 					if (last) {
@@ -207,17 +210,13 @@
 			} else {  // phase 1
 				if (width >= rect.width) { // next line
 					prevC1LineOffset = c1.position();
-					c1rect.width = 0;
-					width = 0;
 					if (c0rect!=null) { // extend phase 1
 						c0rect.height += tileH;
-						c0rect.width += tileW;
-						c1rect = new FramebufferUpdateRectangle(rect.x, c0rect.y+c0rect.height,0,0);
-						width = 0;
 					} else { // first phase 1 case
 						c0rect = c1rect;
-						c1rect = new FramebufferUpdateRectangle(rect.x, c1rect.y, 0, 0);
 					}
+					c1rect = new FramebufferUpdateRectangle(rect.x, c0rect.y+c0rect.height, 0, 0);
+					width = 0;
 					prevLineOffset = offset;
 				}
 			}