From 27e87003b614af6d3770bd0712fa66a335476318 Mon Sep 17 00:00:00 2001 From: Armaan Gupta Date: Fri, 5 Jul 2024 15:19:14 +0530 Subject: [PATCH 1/2] fix: docs building --- src/capturer/engine/linux/mod.rs | 4 ++-- src/targets/mod.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/capturer/engine/linux/mod.rs b/src/capturer/engine/linux/mod.rs index fc4d32e..bde7307 100644 --- a/src/capturer/engine/linux/mod.rs +++ b/src/capturer/engine/linux/mod.rs @@ -340,10 +340,10 @@ impl LinuxCapturer { show_cursor: options.show_cursor, show_highlight: options.show_highlight, output_type: options.output_type, - targets: options.targets.clone(), + target: options.target.clone(), excluded_targets: None, output_resolution: crate::capturer::Resolution::Captured, - source_rect: None, + crop_area: None, }; let (ready_sender, ready_recv) = sync_channel(1); let capturer_join_handle = std::thread::spawn(move || { diff --git a/src/targets/mod.rs b/src/targets/mod.rs index 836bc7c..a2cff4c 100644 --- a/src/targets/mod.rs +++ b/src/targets/mod.rs @@ -57,7 +57,7 @@ pub fn get_scale_factor(target: &Target) -> f64 { return win::get_scale_factor(target); #[cfg(target_os = "linux")] - return 1; + return 1.0; } pub fn get_main_display() -> Display { @@ -69,6 +69,7 @@ pub fn get_main_display() -> Display { // #[cfg(target_os = "linux")] // return linux::get_main_display(); + } pub fn get_target_dimensions(target: &Target) -> (u64, u64) { From 455021855f50a4041987094fbf5cb77f562e8f52 Mon Sep 17 00:00:00 2001 From: Armaan Gupta Date: Sun, 7 Jul 2024 12:58:02 +0530 Subject: [PATCH 2/2] docs(changed the default docs building target to be windows) --- Cargo.toml | 5 +++++ src/main.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 10180fd..430af08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,3 +37,8 @@ objc = "0.2.7" pipewire = "0.8.0" dbus = "0.9.7" rand = "0.8.5" + +[package.metadata.docs.rs] +cargo-features = ["--no-default-features"] +cargo_args = ["--no-deps"] +default-target = "x86_64-pc-windows-msvc" diff --git a/src/main.rs b/src/main.rs index 4446323..b2e75a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ // This program is just a testing application // Refer to `lib.rs` for the library source code + use scap::{ capturer::{Area, Capturer, Options, Point, Size}, frame::Frame,