equal
deleted
inserted
replaced
15 |
15 |
16 impl<T: Copy + PartialEq> Land2D<T> { |
16 impl<T: Copy + PartialEq> Land2D<T> { |
17 pub fn new(play_size: Size, fill_value: T) -> Self { |
17 pub fn new(play_size: Size, fill_value: T) -> Self { |
18 let real_size = play_size.next_power_of_two(); |
18 let real_size = play_size.next_power_of_two(); |
19 let top_left = Point::new( |
19 let top_left = Point::new( |
20 (real_size.width - play_size.width / 2) as i32, |
20 ((real_size.width - play_size.width) / 2) as i32, |
21 (real_size.height - play_size.height) as i32, |
21 (real_size.height - play_size.height) as i32, |
22 ); |
22 ); |
23 let play_box = Rect::from_size(top_left, play_size); |
23 let play_box = Rect::from_size(top_left, play_size); |
24 Self { |
24 Self { |
25 play_size, |
25 play_size, |