]> source.dussan.org Git - tigervnc.git/commitdiff
[Developement] Add copyrect handler code to copyrect decoder.
authorenikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Thu, 25 Dec 2008 08:03:49 +0000 (08:03 +0000)
committerenikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Thu, 25 Dec 2008 08:03:49 +0000 (08:03 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3463 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tightvnc/decoder/CopyRectDecoder.java

index 3fceb631b47344631533f7e19515a7b821273c08..07a14bdb05a890a72c2d8261aa6ebc1a1db934e4 100644 (file)
@@ -35,8 +35,16 @@ public class CopyRectDecoder extends RawDecoder {
       dos.writeInt(CopyRectDecoder.EncodingCopyRect);
     }
 
-    //
-    // TODO: Place copy rect handler code here
-    //
+    int copyRectSrcX = rfbis.readU16();
+    int copyRectSrcY = rfbis.readU16();
+
+    // If the session is being recorded:
+    if (dos != null) {
+      dos.writeShort(copyRectSrcX);
+      dos.writeShort(copyRectSrcY);
+    }
+
+    graphics.copyArea(copyRectSrcX, copyRectSrcY, w, h,
+                      x - copyRectSrcX, y - copyRectSrcY);
   }
 }