mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-28 11:36:34 +00:00
renderer/metal: apply layerContentsPlacement on macOS to fix stretching
Fixes #42
This commit is contained in:
@@ -327,6 +327,10 @@ pub fn init(alloc: Allocator, options: renderer.Options) !Metal {
|
||||
if (comptime builtin.os.tag == .macos) {
|
||||
info.view.setProperty("layer", layer.value);
|
||||
info.view.setProperty("wantsLayer", true);
|
||||
|
||||
// The layer gravity is set to top-left so that when we resize
|
||||
// the view, the contents aren't stretched before a redraw.
|
||||
layer.setProperty("contentsGravity", macos.animation.kCAGravityTopLeft);
|
||||
}
|
||||
|
||||
// Ensure that our metal layer has a content scale set to match the
|
||||
|
||||
Reference in New Issue
Block a user