diff --git a/src/backend/renderer/mod.rs b/src/backend/renderer/mod.rs index 8a2b3a6..a975894 100644 --- a/src/backend/renderer/mod.rs +++ b/src/backend/renderer/mod.rs @@ -175,13 +175,14 @@ pub trait Frame { /// Render a texture to the current target as a flat 2d-plane at a given /// position and applying the given transformation with the given alpha value. + /// (Meaning `src_transform` should match the orientation of surface being rendered). fn render_texture_at( &mut self, texture: &Self::TextureId, pos: Point, texture_scale: i32, output_scale: f64, - transform: Transform, + src_transform: Transform, alpha: f32, ) -> Result<(), Self::Error> { self.render_texture_from_to( @@ -195,19 +196,20 @@ pub trait Frame { .to_f64() .to_physical(output_scale), ), - transform, + src_transform, alpha, ) } - /// Render part of a texture as given by src to the current target into the rectangle described by dest - /// as a flat 2d-plane after applying the given transformations. + /// Render part of a texture as given by src to the current target into the rectangle described by dst + /// as a flat 2d-plane after applying the inverse of the given transformation. + /// (Meaning `src_transform` should match the orientation of surface being rendered). fn render_texture_from_to( &mut self, texture: &Self::TextureId, src: Rectangle, - dest: Rectangle, - transform: Transform, + dst: Rectangle, + src_transform: Transform, alpha: f32, ) -> Result<(), Self::Error>; } @@ -236,7 +238,7 @@ pub trait Renderer { fn render( &mut self, size: Size, - transform: Transform, + dst_transform: Transform, rendering: F, ) -> Result where