From 37d371e225060fef6a1f18cd7fbaa82273f95f16 Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Wed, 24 May 2017 22:33:25 -0400 Subject: [PATCH] CopyRectDecoder missing getAffectedRegion method in java viewer --- java/com/tigervnc/rfb/CopyRectDecoder.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/java/com/tigervnc/rfb/CopyRectDecoder.java b/java/com/tigervnc/rfb/CopyRectDecoder.java index a4298fd5..40452e21 100644 --- a/java/com/tigervnc/rfb/CopyRectDecoder.java +++ b/java/com/tigervnc/rfb/CopyRectDecoder.java @@ -31,6 +31,20 @@ public class CopyRectDecoder extends Decoder { os.copyBytes(is, 4); } + public void getAffectedRegion(Rect rect, Object buffer, + int buflen, ConnParams cp, + Region region) + { + MemInStream is = new MemInStream((byte[])buffer, 0, buflen); + int srcX = is.readU16(); + int srcY = is.readU16(); + + super.getAffectedRegion(rect, buffer, buflen, cp, region); + + region.assign_union(new Region(rect.translate(new Point(srcX-rect.tl.x, + srcY-rect.tl.y)))); + } + public void decodeRect(Rect r, Object buffer, int buflen, ConnParams cp, ModifiablePixelBuffer pb) -- 2.39.5