Avoid drawing out of bounds by drawing just the intersection of dirtyRect and bounds.

This commit is contained in:
Brent Simmons 2025-01-20 17:04:37 -08:00
parent 97757a567f
commit ccb1b8294e

View File

@ -89,7 +89,8 @@ final class IconView: NSView {
let color = NSApplication.shared.effectiveAppearance.isDarkMode ? IconView.darkBackgroundColor : IconView.lightBackgroundColor
color.set()
dirtyRect.fill()
let r = NSIntersectionRect(dirtyRect, bounds)
r.fill()
}
}