mod document;
mod elements;
mod style;
pub use document::*;
pub use elements::*;
pub use style::*;
pub trait Positioned {
fn x(&self) -> f64;
fn y(&self) -> f64;
fn width(&self) -> f64;
fn height(&self) -> f64;
}
impl Positioned for FixedElement {
fn x(&self) -> f64 {
self.x
}
fn y(&self) -> f64 {
self.y
}
fn width(&self) -> f64 {
self.width
}
fn height(&self) -> f64 {
self.height
}
}
impl Positioned for FloatingImage {
fn x(&self) -> f64 {
self.offset_x
}
fn y(&self) -> f64 {
self.offset_y
}
fn width(&self) -> f64 {
self.image.width.unwrap_or(0.0)
}
fn height(&self) -> f64 {
self.image.height.unwrap_or(0.0)
}
}
impl Positioned for FloatingTextBox {
fn x(&self) -> f64 {
self.offset_x
}
fn y(&self) -> f64 {
self.offset_y
}
fn width(&self) -> f64 {
self.width
}
fn height(&self) -> f64 {
self.height
}
}
#[cfg(test)]
#[path = "positioned_tests.rs"]
mod positioned_tests;