fix: moved battery widget and popup view from dirtyRect to the frame

This commit is contained in:
Serhiy Mytrovtsiy
2023-09-30 18:02:47 +02:00
parent 30f799d6f1
commit 80b39144b1
2 changed files with 5 additions and 5 deletions

View File

@@ -374,10 +374,10 @@ internal class BatteryView: NSView {
guard let ctx = NSGraphicsContext.current?.cgContext else { return }
let w: CGFloat = min(dirtyRect.width, 120)
let h: CGFloat = min(dirtyRect.height, 50)
let x: CGFloat = (dirtyRect.width - w)/2
let y: CGFloat = (dirtyRect.size.height - h) / 2
let w: CGFloat = min(self.frame.width, 120)
let h: CGFloat = min(self.frame.height, 50)
let x: CGFloat = (self.frame.width - w)/2
let y: CGFloat = (self.frame.size.height - h) / 2
let batteryFrame = NSBezierPath(roundedRect: NSRect(x: x+1, y: y+1, width: w-8, height: h-2), xRadius: 3, yRadius: 3)
NSColor.textColor.set()