INNER CODE UNIT · Rust

get_capture_overlay_elements

free-explorers/veshell · src/embedder/backend/render/mod.rs:189

pub fn get_capture_overlay_elements<R>(
    output_geometry: Rectangle<f64, Logical>,
    scale: f64,
    session: &CaptureSession,
) -> Vec<VeshellRenderElements<R>>
where
    R: Renderer + ImportAll + ImportMem,
    <R as RendererSuper>::TextureId: Send + Clone + 'static,
    <R as RendererSuper>::Error:,
    VeshellRenderElements<R>: RenderElement<R>,
{
    // Converts a global logical rectangle to a physical one relative to the
    // output's own top-left corner, as expected by the render output.
    let to_local_physical = |rect: Rectangle<f64, Logical>| -> Rectangle<i32, Physical> {
        let left = ((rect.loc.x - output_geometry.loc.x) * scale) as i32;
        let top = ((rect.loc.y - output_geometry.loc.y) * scale) as i32;
        let width = (rect.size.w * scale).ceil() as i32;
        let height = (rect.size.h * scale).ceil() as i32;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…