use crate::{Point, Range, Rect};
pub use crate::widget::primitive::widget::Widget;
pub mod image;
pub mod shape;
pub mod text;
pub mod widget;
pub mod v_stack;
pub mod frame;
pub mod h_stack;
pub mod z_stack;
pub mod padding;
pub mod spacer;
pub mod edge_insets;
pub mod foreach;
pub mod overlaid_layer;
pub mod scroll;
pub mod clip;
pub mod hidden;
pub mod canvas;
pub mod offset;
pub mod border;
pub fn bounding_box_for_points<I>(mut points: I) -> Rect
where I: Iterator<Item=Point>,
{
points.next().map(|first| {
let start_rect = Rect {
x: Range { start: first[0], end: first[0] },
y: Range { start: first[1], end: first[1] },
};
points.fold(start_rect, Rect::stretch_to_point)
}).unwrap_or_else(|| Rect::from_xy_dim([0.0, 0.0], [0.0, 0.0]))
}