Skip to content

Commit

Permalink
fix bugs and append insets
Browse files Browse the repository at this point in the history
  • Loading branch information
idmota committed Jun 21, 2023
1 parent 171a656 commit 3798cb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class MarginLabel: UILabel {

// MARK: Private Properties

private var edgeInsets = UIEdgeInsets.init(top: 0.0, left: 5.0, bottom: 0.0, right: 5.0)
private var edgeInsets = UIEdgeInsets.init(top: 3.0, left: 5.0, bottom: 3.0, right: 5.0)

// MARK: Properties Overriders

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class PerformanceMonitor {
public static let system = DisplayOptions(rawValue: 1 << 4)

/// Default dispaly options - CPU usage and FPS, application version with build number and system name with version.
public static let `default`: DisplayOptions = [.performance, .application, .system]
public static let `default`: DisplayOptions = [.performance, memory]

/// All dispaly options.
public static let all: DisplayOptions = [.performance, .memory, .application, .device, .system]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ private extension PerformanceView {
if windowHeight != labelSize.height {
self.frame = PerformanceView.windowFrame(withPrefferedHeight: self.monitoringTextLabel.bounds.height)
}
self.monitoringTextLabel.frame = CGRect(x: (windowWidth - labelSize.width) / 2.0, y: (windowHeight - labelSize.height) / 2.0, width: labelSize.width, height: labelSize.height)

self.monitoringTextLabel.frame = CGRect(x: (windowWidth - labelSize.width) - 16, y: (windowHeight - labelSize.height) / 2.0, width: labelSize.width, height: labelSize.height)
}
}

Expand Down Expand Up @@ -345,12 +345,13 @@ private extension PerformanceView {
}

var topInset: CGFloat = 0.0
let offset: CGFloat = 4.0
if #available(iOS 11.0, *), let safeAreaTop = window.rootViewController?.view.safeAreaInsets.top {
if safeAreaTop > 0.0 {
if safeAreaTop > Constants.defaultStatusBarHeight {
topInset = safeAreaTop - Constants.safeAreaInsetDifference
topInset = safeAreaTop - Constants.safeAreaInsetDifference - offset
} else {
topInset = safeAreaTop - Constants.defaultStatusBarHeight
topInset = safeAreaTop - Constants.defaultStatusBarHeight - offset
}
} else {
topInset = safeAreaTop
Expand Down

0 comments on commit 3798cb5

Please sign in to comment.