mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: adjusted network chart baseline
This commit is contained in:
@@ -340,7 +340,6 @@ public class NetworkChartView: NSView {
|
||||
}
|
||||
|
||||
let lineWidth = 1 / (NSScreen.main?.backingScaleFactor ?? 1)
|
||||
let offset = lineWidth / 2
|
||||
let zero: CGFloat = (dirtyRect.height/2) + dirtyRect.origin.y
|
||||
let xRatio: CGFloat = (dirtyRect.width + (lineWidth*3)) / CGFloat(points.count)
|
||||
|
||||
@@ -348,10 +347,10 @@ public class NetworkChartView: NSView {
|
||||
return (CGFloat(point) * xRatio) + (dirtyRect.origin.x - lineWidth)
|
||||
}
|
||||
let uploadYPoint = { (point: Int) -> CGFloat in
|
||||
return scaleValue(scale: self.scale, value: points[point].0, maxValue: uploadMax, maxHeight: dirtyRect.height/2) + (dirtyRect.origin.y + dirtyRect.height/2 - offset)
|
||||
return scaleValue(scale: self.scale, value: points[point].0, maxValue: uploadMax, maxHeight: dirtyRect.height/2) + (dirtyRect.height/2 + dirtyRect.origin.y)
|
||||
}
|
||||
let downloadYPoint = { (point: Int) -> CGFloat in
|
||||
return (dirtyRect.height/2 + dirtyRect.origin.y + offset) - scaleValue(scale: self.scale, value: points[point].1, maxValue: downloadMax, maxHeight: dirtyRect.height/2)
|
||||
return (dirtyRect.height/2 + dirtyRect.origin.y) - scaleValue(scale: self.scale, value: points[point].1, maxValue: downloadMax, maxHeight: dirtyRect.height/2)
|
||||
}
|
||||
|
||||
let uploadlinePath = NSBezierPath()
|
||||
|
||||
Reference in New Issue
Block a user