We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba3b823 commit 44d1abaCopy full SHA for 44d1aba
src/cg.rs
@@ -7,7 +7,7 @@ use core_graphics::geometry::CGSize;
7
use core_graphics::image::CGImage;
8
9
use cocoa::base::id;
10
-use cocoa::quartzcore::CALayer;
+use cocoa::quartzcore::{CALayer, ContentsGravity};
11
use foreign_types::ForeignType;
12
13
pub struct CGImpl {
@@ -18,6 +18,7 @@ impl CGImpl {
18
pub unsafe fn new<W: HasRawWindowHandle>(handle: AppKitHandle) -> Result<Self, SoftBufferError<W>> {
19
let view = handle.ns_view as id;
20
let layer = CALayer::new();
21
+ layer.set_contents_gravity(ContentsGravity::TopLeft);
22
let _: () = msg_send![view, setLayer:layer.clone()];
23
Ok(Self{layer})
24
}
0 commit comments