fix: fixed missing underline fill of network chart when combined widgets or modules are enabled (#2478)

This commit is contained in:
Serhiy Mytrovtsiy
2025-05-24 22:35:03 +02:00
parent 48836fcd34
commit 56bbd566ba
3 changed files with 8 additions and 6 deletions

View File

@@ -209,23 +209,25 @@ public class NetworkChart: WidgetWrapper {
context.saveGState()
var underLinePath = topLinePath.copy() as! NSBezierPath
underLinePath.line(to: CGPoint(x: columnXPoint(points.count), y: zero))
underLinePath.line(to: CGPoint(x: columnXPoint(points.count - 1), y: zero))
underLinePath.line(to: CGPoint(x: columnXPoint(0), y: zero))
underLinePath.close()
underLinePath.addClip()
bottomColor?.withAlphaComponent(0.5).setFill()
NSBezierPath(rect: self.frame).fill()
let topFillRect = NSRect(x: chartFrame.origin.x - lineWidth, y: chartFrame.origin.y, width: chartFrame.width + (lineWidth*3), height: chartFrame.height)
NSBezierPath(rect: topFillRect).fill()
context.restoreGState()
context.saveGState()
underLinePath = bottomLinePath.copy() as! NSBezierPath
underLinePath.line(to: CGPoint(x: columnXPoint(points.count), y: zero))
underLinePath.line(to: CGPoint(x: columnXPoint(points.count - 1), y: zero))
underLinePath.line(to: CGPoint(x: columnXPoint(0), y: zero))
underLinePath.close()
underLinePath.addClip()
topColor?.withAlphaComponent(0.5).setFill()
NSBezierPath(rect: self.frame).fill()
let bottomFillRect = NSRect(x: chartFrame.origin.x - lineWidth, y: chartFrame.origin.y, width: chartFrame.width + (lineWidth*3), height: chartFrame.height)
NSBezierPath(rect: bottomFillRect).fill()
context.restoreGState()