The code works except that I am struggling with getting the box to not expand to the right which exposes the background past the scaled down border. This is the XIB in question without these changes: https://github.com/HearthSim/HSTracker/blob/master/HSTracker/UIs/Battlegrounds/Base.lproj/BattlegroundsSession.xib
Let me know if you have any suggestions
Post
Replies
Boosts
Views
Activity
Thanks, this mostly works. My hierarchy is like this:
Window
NSBox with custom background
+- NSStackView
...
I added a wrapper NSView around the NSBox and followed your suggestion:
guard let window else {
return
}
let bounds = sessionPanel.bounds
let sw = bounds.width * 0.9
let sh = bounds.height * 0.9
outerBox.frame = NSRect(x: 0, y: window.frame.height - sh, width: sw, height: sh)
outerBox.bounds = bounds
Wouldn't that always crash though? This doesn't have a very large number of reports, so it is not happening that consistently. I have never seen this crash on my local development machine either.
I double checked the connection the XIB source and nothing really looked out of the ordinary. I would have expected a corruption to always crash when running under the debugger.