svg-path-bbox 0.0.1

SVG paths bounding box calculator in Rust
Documentation
use std::io::Error;

mod parse;
mod tokenize;
mod types;

use types::*;

impl BBox {
    fn new() -> Self {
        Self {
            min_x: f64::INFINITY,
            max_x: f64::NEG_INFINITY,
            min_y: f64::INFINITY,
            max_y: f64::NEG_INFINITY,
        }
    }

    fn update(mut self, new_bbox: BBox) {
        self.min_x = self.min_x.min(new_bbox.min_x);
        self.max_x = self.max_x.max(new_bbox.max_x);
        self.min_y = self.min_y.max(new_bbox.min_y);
        self.max_y = self.max_y.max(new_bbox.max_y);
    }
}

pub fn svg_path_bbox(path: &str) -> Result<BBox, Error> {
    todo!()
}