From e67961038d32cf3782403a4bafac7a19d9b3671e Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Sun, 13 Jul 2025 10:15:58 +0200 Subject: [PATCH] v2.11.47 --- Kit/plugins/Charts.swift | 9 ++++++++- Stats.xcodeproj/project.pbxproj | 6 +++--- Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme | 2 +- Stats.xcodeproj/xcshareddata/xcschemes/Stats.xcscheme | 2 +- .../xcshareddata/xcschemes/WidgetsExtension.xcscheme | 2 +- Stats/Supporting Files/Info.plist | 2 +- Widgets/Supporting Files/Info.plist | 4 ++-- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Kit/plugins/Charts.swift b/Kit/plugins/Charts.swift index 1114d638..f8b87d23 100644 --- a/Kit/plugins/Charts.swift +++ b/Kit/plugins/Charts.swift @@ -839,9 +839,14 @@ public class BarChartView: NSView { values = self.values } + guard !values.isEmpty else { return } + let blocks: Int = 16 let spacing: CGFloat = 2 let count: CGFloat = CGFloat(values.count) + // swiftlint:disable:next empty_count + guard count > 0, self.frame.width > 0, self.frame.height > 0 else { return } + let partitionSize: CGSize = CGSize(width: (self.frame.width - (count*spacing)) / count, height: self.frame.height) let blockSize = CGSize(width: partitionSize.width-(spacing*2), height: ((partitionSize.height - spacing - 1)/CGFloat(blocks))-1) @@ -892,7 +897,9 @@ public class BarChartView: NSView { if let block = matchingBlock { let value = "\(Int(block.value.rounded(toPlaces: 2) * 100))%" let width: CGFloat = block.value == 1 ? 38 : block.value > 0.1 ? 32 : 24 - drawToolTip(self.frame, CGPoint(x: p.x+4, y: p.y+4), CGSize(width: width, height: partitionSize.height), value: value) + let tooltipX = min(p.x+4, self.frame.width - width) + let tooltipY = min(p.y+4, self.frame.height - partitionSize.height) + drawToolTip(self.frame, CGPoint(x: tooltipX, y: tooltipY), CGSize(width: width, height: min(partitionSize.height, self.frame.height)), value: value) } } } diff --git a/Stats.xcodeproj/project.pbxproj b/Stats.xcodeproj/project.pbxproj index b3127350..d6bbb557 100644 --- a/Stats.xcodeproj/project.pbxproj +++ b/Stats.xcodeproj/project.pbxproj @@ -1717,7 +1717,7 @@ New, ); LastSwiftUpdateCheck = 1540; - LastUpgradeCheck = 1620; + LastUpgradeCheck = 1640; ORGANIZATIONNAME = "Serhiy Mytrovtsiy"; TargetAttributes = { 5C22299C29CCB3C400F00E69 = { @@ -2867,7 +2867,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 2.11.46; + MARKETING_VERSION = 2.11.47; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2904,7 +2904,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 2.11.46; + MARKETING_VERSION = 2.11.47; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme b/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme index c6d070e8..aa758e4f 100644 --- a/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme +++ b/Stats.xcodeproj/xcshareddata/xcschemes/SMC.xcscheme @@ -1,6 +1,6 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 704 + 706 Description Simple macOS system monitor in your menu bar LSApplicationCategoryType diff --git a/Widgets/Supporting Files/Info.plist b/Widgets/Supporting Files/Info.plist index cfe63343..5490bbd1 100644 --- a/Widgets/Supporting Files/Info.plist +++ b/Widgets/Supporting Files/Info.plist @@ -11,9 +11,9 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleShortVersionString - 2.11.46 + 2.11.47 CFBundleVersion - 704 + 706 NSExtension NSExtensionPointIdentifier