# HG changeset patch # User alfadur # Date 1541177116 -10800 # Node ID 43d956f41cd46c06b24bac233baaf6a69cb693d0 # Parent 30565866db8240c5312493df9e9328f670ba53dc update theme editor diff -r 30565866db82 -r 43d956f41cd4 rust/theme-editor/src/main.rs --- a/rust/theme-editor/src/main.rs Fri Nov 02 17:43:06 2018 +0100 +++ b/rust/theme-editor/src/main.rs Fri Nov 02 19:45:16 2018 +0300 @@ -7,7 +7,7 @@ } }; -use integral_geometry::{Point, Size, Rect}; +use integral_geometry::{Point, Size, Rect, Line}; use rand::{ thread_rng, RngCore, Rng, @@ -15,10 +15,8 @@ }; use landgen::{ - template_based::{ - OutlineTemplate, - TemplatedLandGenerator - }, + template_based::TemplatedLandGenerator, + outline_template::OutlineTemplate, LandGenerator, LandGenerationParameters }; @@ -75,7 +73,7 @@ Point::new(rnd(WIDTH as i32), rnd(HEIGHT as i32)) } fn rect() -> Rect { - Rect::new(rnd(WIDTH as i32), rnd(HEIGHT as i32), rnd(128), rnd(128)) + Rect::new(rnd(WIDTH as i32), rnd(HEIGHT as i32), rnd(120) + 8, rnd(120) + 8) } fn init_source() -> LandSource { @@ -89,7 +87,7 @@ fn draw_random_lines(land: &mut Land2D) { for i in 0..32 { - land.draw_thick_line(point(), point(), rnd(5), u32::max_value()); + land.draw_thick_line(Line::new(point(), point()), rnd(5), u32::max_value()); land.fill_circle(point(), rnd(60), u32::max_value()); }