use crate::path::{Path, Point, Shape, Stroke, stroke};
use crate::render::Rect;
fn lines(parts: &[&[Point]]) -> Shape {
let rings = parts.iter().flat_map(|l| stroke(l, Stroke::round(2.0)));
let contours = rings.flat_map(|r| Path::polygon(&r).contours).collect();
Shape::new(Path { contours }, Rect::new(0.0, 0.0, 24.0, 24.0))
}
thread_local! {
static MENU: Shape = lines(&[
&[[4.0, 6.0], [20.0, 6.0]],
&[[4.0, 12.0], [20.0, 12.0]],
&[[4.0, 18.0], [20.0, 18.0]],
]);
static BACK: Shape = lines(&[
&[[19.0, 12.0], [5.0, 12.0]],
&[[12.0, 19.0], [5.0, 12.0], [12.0, 5.0]],
]);
static CLOSE: Shape = lines(&[&[[18.0, 6.0], [6.0, 18.0]], &[[6.0, 6.0], [18.0, 18.0]]]);
}
pub fn menu() -> Shape {
MENU.with(Shape::clone)
}
pub fn back() -> Shape {
BACK.with(Shape::clone)
}
pub fn close() -> Shape {
CLOSE.with(Shape::clone)
}