mark the center in the theme editor
authoralfadur
Sat, 03 Nov 2018 01:52:05 +0300
changeset 14107 c6923ce139a2
parent 14106 ceda58e398e0
child 14108 8556937ae338
mark the center in the theme editor
rust/theme-editor/src/main.rs
--- a/rust/theme-editor/src/main.rs	Sat Nov 03 01:47:39 2018 +0300
+++ b/rust/theme-editor/src/main.rs	Sat Nov 03 01:52:05 2018 +0300
@@ -127,13 +127,22 @@
         .add_fill_points(&[Point::new(1023, 0)])
 }
 
-
 fn init_source() -> LandSource<TemplatedLandGenerator> {
     let template = test_template();
     let generator = TemplatedLandGenerator::new(template);
     LandSource::new(generator)
 }
 
+fn draw_center_mark(land: &mut Land2D<u32>) {
+    for i in 0..32 {
+        land.draw_thick_line(Line::new(Point::new(LAND_WIDTH as i32 / 2, 0),
+                                       Point::new(LAND_WIDTH as i32 / 2, LAND_HEIGHT as i32)), 10, 128);
+        land.draw_thick_line(Line::new(Point::new(0, LAND_HEIGHT as i32 / 2),
+                                       Point::new(LAND_WIDTH as i32, LAND_HEIGHT as i32 / 2)), 10, 128);
+        land.fill_circle(Point::new(LAND_WIDTH as i32, LAND_HEIGHT as i32) / 2, 60, 128);
+    }
+}
+
 fn draw_random_lines(land: &mut Land2D<u32>) {
     for i in 0..32 {
         land.draw_thick_line(Line::new(point(), point()), rnd(5), 128);
@@ -156,8 +165,7 @@
     let mut source = init_source();
     let mut land = source.next(
         LandGenerationParameters::new(0, u32::max_value()));
-    draw_random_lines(&mut land);
-
+    draw_center_mark(&mut land);
 
     let mut land_surf = Surface::new(LAND_WIDTH, LAND_HEIGHT, PixelFormatEnum::ARGB8888).unwrap();