Honor scale factor when rendering

This commit is contained in:
Antonio Scandurra 2022-08-31 12:02:57 +02:00
parent 3f66dd678a
commit a02e388ea2
2 changed files with 3 additions and 3 deletions

View file

@ -123,8 +123,8 @@ impl ScreenCaptureView {
// let filter: id = msg_send![filter, initWithDesktopIndependentWindow: window];
let config: id = msg_send![class!(SCStreamConfiguration), alloc];
let config: id = msg_send![config, init];
let _: () = msg_send![config, setWidth: display_width];
let _: () = msg_send![config, setHeight: display_height];
let _: () = msg_send![config, setWidth: display_width * 2];
let _: () = msg_send![config, setHeight: display_height * 2];
let _: () = msg_send![config, setMinimumFrameInterval: bindings::CMTimeMake(1, 60)];
let _: () = msg_send![config, setQueueDepth: 6];
let _: () = msg_send![config, setShowsCursor: YES];

View file

@ -816,7 +816,7 @@ impl Renderer {
surface.image_buffer.width() as i32,
surface.image_buffer.height() as i32,
);
let target_size = surface.bounds.size();
let target_size = surface.bounds.size() * scale_factor;
let pixel_format = if surface.image_buffer.pixel_format_type()
== core_video::kCVPixelFormatType_32BGRA
{