mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-11-09 13:31:25 +03:00
Use new currentDrawing() for NSAppearance
This commit is contained in:
parent
498406bce6
commit
74d6a38ad8
@ -41,12 +41,12 @@ extension NSColor {
|
||||
/// - Returns: A CGColor instance.
|
||||
func cgColor(for appearance: NSAppearance) -> CGColor {
|
||||
|
||||
guard NSAppearance.current != appearance else { return self.cgColor }
|
||||
guard NSAppearance.currentDrawing() != appearance else { return self.cgColor }
|
||||
|
||||
let currentAppearance = NSAppearance.current
|
||||
NSAppearance.current = appearance
|
||||
let cgColor = self.cgColor
|
||||
NSAppearance.current = currentAppearance
|
||||
var cgColor: CGColor = .clear
|
||||
appearance.performAsCurrentDrawingAppearance {
|
||||
cgColor = self.cgColor
|
||||
}
|
||||
|
||||
return cgColor
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user