minor refactoring

This commit is contained in:
Nihaal Sharma committed 2026-10-17 00:35:34 +01:00
1 parent 93a02f9a48
commit 49cf17b99a
5 files changed
+32 -20

No files matched your search

+9 -3
View File
@@ -25,7 +25,8 @@ class Goose: NSViewController {
}
func setup() {
gooseView.frame = NSRect(x: 100, y: 100, width: 25, height: 25)
gooseView.translatesAutoresizingMaskIntoConstraints = false
gooseView.frame = NSRect(x: 100, y: 100, width: 50, height: 50)
self.view.addSubview(gooseView)
let bodyView = NSImageView(image: NSImage(named: "body")!)
@@ -41,10 +42,15 @@ class Goose: NSViewController {
gooseView.addSubview(neckView)
neckView.translatesAutoresizingMaskIntoConstraints = false
neckView.rotate(byDegrees: 90)
neckView.frame = NSRect(x: 0, y: 0, width: 30, height: 30)
NSLayoutConstraint.activate([
neckView.widthAnchor.constraint(equalToConstant: 25),
neckView.heightAnchor.constraint(equalToConstant: 25)
neckView.leftAnchor.constraint(equalTo: bodyView.leftAnchor),
neckView.bottomAnchor.constraint(equalTo: bodyView.bottomAnchor),
neckView.widthAnchor.constraint(equalToConstant: 30),
neckView.heightAnchor.constraint(equalToConstant: 30)
])
bodyView.alphaValue = 0.5
neckView.alphaValue = 0.5
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.