Packages

Elixir bindings for pdf_oxide, a high-performance PDF library written in Rust.

Current section

Files

Jump to
pdf_elixide native pdf_elixide_nif src geometry.rs
Raw

native/pdf_elixide_nif/src/geometry.rs

use pdf_oxide::geometry::Rect;
use rustler::NifStruct;
#[derive(NifStruct, Debug)]
#[module = "PdfElixide.Geometry.Rect"]
pub struct RectNif {
x: f32,
y: f32,
width: f32,
height: f32,
}
pub fn rect_to_nif(rect: Rect) -> RectNif {
RectNif {
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height,
}
}