From 1a75e8b7e0d3159dea43c11748e0492ee4d3d929 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Fri, 14 Feb 2020 20:08:40 +0000 Subject: [PATCH] Fix horizontal bit shifting * src/nsterm.m ([EmacsView copyRect:to:]): Calculate the horizontal difference instead of just the vertical. ([EmacsView updateLayer]): Fix NSTRACE message. --- src/nsterm.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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]; -- 2.39.5