/// Create a transformation to undo the screen rotation.
Create a transformation to undo the screen rotation.
Create a transformation to undo the screen rotation .
pub fn inv_transform(&self, target_size: &Size2D<Coord>) -> Transform2D<Coord> {
        let w = target_size.width;
        let h = target_size.height;
        match self {
            Self::Deg0 => Transform2D::identity(),
            Self::Deg90 => Transform2D::from_array([0.0, 1.0, -1.0, 0.0, h, 0.0]),
            Self::Deg180 => Transform2D::from_array([-1.0, 0.0, 0.0, -1.0, w, h]),
            Self::Deg270 => Transform2D::from_array([0.0, -1.0, 1.0, 0.0, 0.0, w]),
        }
    }
pub fn inv_transform ( & self , target_size : & Size2D < Coord > ) -> Transform2D < Coord > { let w = target_size . width ; let h = target_size . height ; match self { Self :: Deg0 => Transform2D :: identity ( ) , Self :: Deg90 => Transform2D :: from_array ( [ 0.0 , 1.0 , - 1.0 , 0.0 , h , 0.0 ] ) , Self :: Deg180 => Transform2D :: from_array ( [ - 1.0 , 0.0 , 0.0 , - 1.0 , w , h ] ) , Self :: Deg270 => Transform2D :: from_array ( [ 0.0 , - 1.0 , 1.0 , 0.0 , 0.0 , w ] ) , } }
Create a transformation to undo the screen rotation.
Create a transformation to undo the screen rotation .
&self
target_size
&Size2D<Coord>