summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2020-02-14 20:08:40 +0000
committerAlan Third <alan@idiocy.org>2020-02-19 11:07:44 +0000
commit1a75e8b7e0d3159dea43c11748e0492ee4d3d929 (patch)
tree6e083df463bbc1cce8ee930fdc0aea0b8254bb21
parent52dbd70f0ed6896c3524d14834b489cef8584ada (diff)
downloademacs-1a75e8b7e0d3159dea43c11748e0492ee4d3d929.tar.gz
Fix horizontal bit shifting
* src/nsterm.m ([EmacsView copyRect:to:]): Calculate the horizontal difference instead of just the vertical. ([EmacsView updateLayer]): Fix NSTRACE message.
-rw-r--r--src/nsterm.m7
1 files 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];