diff --git a/src/cg.rs b/src/cg.rs index a8fecc6..1f6d10c 100644 --- a/src/cg.rs +++ b/src/cg.rs @@ -7,7 +7,7 @@ use core_graphics::geometry::CGSize; use core_graphics::image::CGImage; use cocoa::base::id; -use cocoa::quartzcore::CALayer; +use cocoa::quartzcore::{CALayer, ContentsGravity}; use foreign_types::ForeignType; pub struct CGImpl { @@ -18,6 +18,7 @@ impl CGImpl { pub unsafe fn new(handle: AppKitHandle) -> Result> { let view = handle.ns_view as id; let layer = CALayer::new(); + layer.set_contents_gravity(ContentsGravity::TopLeft); let _: () = msg_send![view, setLayer:layer.clone()]; Ok(Self{layer}) }