From 906a985bef6a3905d46a59c1b93ab965b10cc6da Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 29 Nov 2024 21:43:42 -0800 Subject: [PATCH] =?UTF-8?q?Fix=20display=20issue=20in=20Account=20prefs=20?= =?UTF-8?q?=E2=80=94=C2=A0don=E2=80=99t=20draw=20outside=20of=20bounds.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mac/Preferences/PreferencesControlsBackgroundView.swift | 4 +++- Mac/Preferences/PreferencesTableViewBackgroundView.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Mac/Preferences/PreferencesControlsBackgroundView.swift b/Mac/Preferences/PreferencesControlsBackgroundView.swift index 36353dd6b..5625f3d3d 100644 --- a/Mac/Preferences/PreferencesControlsBackgroundView.swift +++ b/Mac/Preferences/PreferencesControlsBackgroundView.swift @@ -26,9 +26,11 @@ final class PreferencesControlsBackgroundView: NSView { } override func draw(_ dirtyRect: NSRect) { + let fillColor = self.effectiveAppearance.isDarkMode ? darkModeFillColor : lightModeFillColor fillColor.setFill() - dirtyRect.fill() + let r = NSIntersectionRect(dirtyRect, bounds) + r.fill() let borderColor = self.effectiveAppearance.isDarkMode ? darkModeBorderColor : lightModeBorderColor borderColor.set() diff --git a/Mac/Preferences/PreferencesTableViewBackgroundView.swift b/Mac/Preferences/PreferencesTableViewBackgroundView.swift index 34548e429..21839a895 100644 --- a/Mac/Preferences/PreferencesTableViewBackgroundView.swift +++ b/Mac/Preferences/PreferencesTableViewBackgroundView.swift @@ -16,6 +16,8 @@ final class PreferencesTableViewBackgroundView: NSView { override func draw(_ dirtyRect: NSRect) { let color = self.effectiveAppearance.isDarkMode ? darkBorderColor : lightBorderColor color.setFill() - dirtyRect.fill() + + let r = NSIntersectionRect(dirtyRect, bounds) + r.fill() } }