Fix display issue in Account prefs — don’t draw outside of bounds.

This commit is contained in:
Brent Simmons
2024-11-29 21:43:42 -08:00
parent fb8a62b698
commit 906a985bef
2 changed files with 6 additions and 2 deletions

View File

@@ -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()

View File

@@ -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()
}
}