diff --git a/src/ui/main-window/TilesPanel.swift b/src/ui/main-window/TilesPanel.swift index 6a3dcf26..de9a7065 100644 --- a/src/ui/main-window/TilesPanel.swift +++ b/src/ui/main-window/TilesPanel.swift @@ -6,7 +6,6 @@ class TilesPanel: NSPanel { static var maxPossibleAppIconSize = NSSize.zero static var shared: TilesPanel! private var frozenTopCenter: NSPoint? - private var highWaterWidth: CGFloat = 0 private var highWaterHeight: CGFloat = 0 convenience init() { @@ -56,21 +55,17 @@ class TilesPanel: NSPanel { resetFrozenPosition() return } - if size.width > highWaterWidth || size.height > highWaterHeight { + if size.height > highWaterHeight { NSScreen.preferred.repositionPanel(self) - highWaterWidth = size.width highWaterHeight = size.height frozenTopCenter = NSPoint(x: frame.midX, y: frame.maxY) } else if let topCenter = frozenTopCenter { - let x = topCenter.x - size.width * 0.5 - let y = topCenter.y - size.height - setFrameOrigin(NSPoint(x: x, y: y)) + setFrameOrigin(NSPoint(x: topCenter.x - size.width * 0.5, y: topCenter.y - size.height)) } } func resetFrozenPosition() { frozenTopCenter = nil - highWaterWidth = 0 highWaterHeight = 0 }