# HG changeset patch # User alfadur # Date 1541199125 -10800 # Node ID c6923ce139a24593115f27c2eb6f9b8d37dce637 # Parent ceda58e398e06639eb22bd15be936350b3640b7f mark the center in the theme editor diff -r ceda58e398e0 -r c6923ce139a2 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 { let template = test_template(); let generator = TemplatedLandGenerator::new(template); LandSource::new(generator) } +fn draw_center_mark(land: &mut Land2D) { + 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) { 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();