From: Alan Third Date: Fri, 14 Feb 2020 20:08:40 +0000 (+0000) Subject: Fix horizontal bit shifting X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~7092 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1a75e8b7e0d3159dea43c11748e0492ee4d3d929;p=emacs.git Fix horizontal bit shifting * src/nsterm.m ([EmacsView copyRect:to:]): Calculate the horizontal difference instead of just the vertical. ([EmacsView updateLayer]): Fix NSTRACE message. --- diff --git a/src/nsterm.m b/src/nsterm.m index 2cf6774a1f1..f31ba5de896 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8295,8 +8295,9 @@ not_in_argv (NSString *arg) offset the top left so when we draw back into the buffer the correct part of the image is drawn. */ CGContextScaleCTM(drawingBuffer, 1, -1); - CGContextTranslateCTM(drawingBuffer, 0, -NSHeight (frame) - - (NSMinY (dstRect) - NSMinY (srcRect))); + CGContextTranslateCTM(drawingBuffer, + NSMinX (dstRect) - NSMinX (srcRect), + -NSHeight (frame) - (NSMinY (dstRect) - NSMinY (srcRect))); /* Take a copy of the buffer and then draw it back to the buffer, limited by the clipping rectangle. */ @@ -8328,7 +8329,7 @@ not_in_argv (NSString *arg) - (void)updateLayer { - NSTRACE ("EmacsView updateLayer]"); + NSTRACE ("[EmacsView updateLayer]"); CGImageRef contentsImage = CGBitmapContextCreateImage(drawingBuffer); [[self layer] setContents:(id)contentsImage];