update theme editor
authoralfadur
Fri, 02 Nov 2018 19:45:16 +0300
changeset 14095 43d956f41cd4
parent 14094 30565866db82
child 14096 24b34b961bea
update theme editor
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<TemplatedLandGenerator> {
@@ -89,7 +87,7 @@
 
 fn draw_random_lines(land: &mut Land2D<u32>) {
     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());
     }