pub fn calc_dimensions(&mut self) {
        let mut min_pos = (10000, 10000);
        let mut max_pos = (-10000, -10000);

        for (pos, _tile)  in &self.data.layer1 {
            if min_pos.0 > pos.0 {
                min_pos.0 = pos.0;
            }
            if min_pos.1 > pos.1 {
                min_pos.1 = pos.1;
            }
            if max_pos.0 < pos.0 {
                max_pos.0 = pos.0;
            }
            if max_pos.1 < pos.1 {
                max_pos.1 = pos.1;
            }
        }

        self.data.min_pos = min_pos;
        self.data.max_pos = max_pos;
    }
/// Calculates the min / max positions
Calculates the min / max positions
Calculates the min / max positions
pub fn calc_dimensions(&mut self) {
        let mut min_pos = (10000, 10000);
        let mut max_pos = (-10000, -10000);
        for (pos, _tile)  in &self.data.layer1 {
            if min_pos.0 > pos.0 {
                min_pos.0 = pos.0;
            }
            if min_pos.1 > pos.1 {
                min_pos.1 = pos.1;
            }
            if max_pos.0 < pos.0 {
                max_pos.0 = pos.0;
            }
            if max_pos.1 < pos.1 {
                max_pos.1 = pos.1;
            }
        }
        self.data.min_pos = min_pos;
        self.data.max_pos = max_pos;
    }
pub fn calc_dimensions ( & mut self ) { let mut min_pos = ( 10000 , 10000 ) ; let mut max_pos = ( - 10000 , - 10000 ) ; for ( pos , _tile ) in & self . data . layer1 { if min_pos . 0 > pos . 0 { min_pos . 0 = pos . 0 ; } if min_pos . 1 > pos . 1 { min_pos . 1 = pos . 1 ; } if max_pos . 0 < pos . 0 { max_pos . 0 = pos . 0 ; } if max_pos . 1 < pos . 1 { max_pos . 1 = pos . 1 ; } } self . data . min_pos = min_pos ; self . data . max_pos = max_pos ; }
Calculates the min / max positions
Calculates the min / max positions
&mut self
&mut self