2021-02-04 12:47:46 +00:00
|
|
|
use svg_fmt::*;
|
|
|
|
use veloren_world::site2::test_site;
|
|
|
|
|
2020-12-26 15:53:06 +00:00
|
|
|
fn main() {
|
2021-02-04 12:47:46 +00:00
|
|
|
let site = test_site();
|
|
|
|
let size = site.bounds().size();
|
2021-02-06 23:53:25 +00:00
|
|
|
println!("{}", BeginSvg {
|
|
|
|
w: size.w as f32,
|
|
|
|
h: size.h as f32
|
|
|
|
});
|
2021-02-04 12:47:46 +00:00
|
|
|
|
|
|
|
for plot in site.plots() {
|
|
|
|
let bounds = plot.find_bounds();
|
|
|
|
println!("{}", Rectangle {
|
|
|
|
x: bounds.min.x as f32,
|
|
|
|
y: bounds.min.y as f32,
|
|
|
|
w: bounds.size().w as f32,
|
|
|
|
h: bounds.size().h as f32,
|
|
|
|
style: Style {
|
2021-02-06 23:53:25 +00:00
|
|
|
fill: Fill::Color(Color {
|
|
|
|
r: 50,
|
|
|
|
g: 50,
|
|
|
|
b: 50
|
|
|
|
}),
|
2021-02-04 12:47:46 +00:00
|
|
|
stroke: Stroke::Color(Color { r: 0, g: 0, b: 0 }, 1.0),
|
|
|
|
opacity: 1.0,
|
|
|
|
stroke_opacity: 1.0,
|
|
|
|
},
|
|
|
|
border_radius: 0.0,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
println!("{}", EndSvg);
|
2020-12-26 15:53:06 +00:00
|
|
|
}
|