Mercurial > hg > Members > riono > TreeVNC_ja_comment
diff src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java @ 501:57ee5c26e8eb
fix multicastput
author | oshiro |
---|---|
date | Sun, 17 Feb 2019 18:39:28 +0900 |
parents | 5455c62a3775 |
children | b9e73589202c |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sun Feb 17 17:55:25 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Sun Feb 17 18:39:28 2019 +0900 @@ -770,7 +770,7 @@ int x = rect.x, y = rect.y, w = 0, h = 0, w0 = 0, h0 = 0; deflater.setInput(bytes,prevoffset,span); c1rect.height = tiley; - if (c1.remaining() < span || x + tilex >= rect.x + rect.width ) { + if (c1.remaining() < span || c1rect.x + c1rect.width + tilex >= rect.x + rect.width ) { deflater.deflate(c1, Deflater.FULL_FLUSH); c1.flip(); try { @@ -778,16 +778,17 @@ } catch (InterruptedException e) { e.printStackTrace(); } + c1rect.x += c1rect.width; + if (c1rect.x >= rect.x + rect.width) { + c1rect.x = rect.x; + c1rect.y += tiley; + } + c1rect.width = 0; c1 = multicastqueue.allocate(deflate_size); } else { deflater.deflate(c1, Deflater.SYNC_FLUSH); } c1rect.width += tilex; - if (c1rect.width >= rect.width) { - c1rect.width = 0; - c1rect.x = 0; - c1rect.y += tiley; - } } private void writeUpdateRectangleWithHeader(ByteBuffer c1, ByteBuffer header, int len2, int x, int y, int w, int h) throws InterruptedException {