From 5cc845d71525421012dbe3f53c9e53f0dc627971 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Thu, 19 May 2022 23:43:31 +0300 Subject: [PATCH] Fix scrolling not updating in the VRAM viewer --- Cocoa/GBImageView.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Cocoa/GBImageView.m b/Cocoa/GBImageView.m index a9b88b6..c496d96 100644 --- a/Cocoa/GBImageView.m +++ b/Cocoa/GBImageView.m @@ -78,6 +78,7 @@ { NSTrackingArea *_trackingArea; GBGridView *_gridView; + NSRect _scrollRect; } - (instancetype)initWithCoder:(NSCoder *)coder @@ -149,4 +150,17 @@ } } +- (void)setScrollRect:(NSRect)scrollRect +{ + if (memcmp(&scrollRect, &_scrollRect, sizeof(scrollRect)) != 0) { + _scrollRect = scrollRect; + [_gridView setNeedsDisplay:true]; + } +} + +- (NSRect)scrollRect +{ + return _scrollRect; +} + @end