mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
copy() and copy_ex() should take a &Texture
`&mut Texture` could imply that the texture gets modified by the two methods, when they really don't. (they at least don't have exterior mutability)
This commit is contained in:
+2
-2
@@ -430,7 +430,7 @@ impl RenderDrawer {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn copy(&mut self, texture: &mut Texture, src: Option<Rect>, dst: Option<Rect>) {
|
||||
pub fn copy(&mut self, texture: &Texture, src: Option<Rect>, dst: Option<Rect>) {
|
||||
let ret = unsafe {
|
||||
ll::SDL_RenderCopy(
|
||||
self.raw,
|
||||
@@ -451,7 +451,7 @@ impl RenderDrawer {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn copy_ex(&mut self, texture: &mut Texture, src: Option<Rect>, dst: Option<Rect>, angle: f64, center: Option<Point>, (flip_horizontal, flip_vertical): (bool, bool)) {
|
||||
pub fn copy_ex(&mut self, texture: &Texture, src: Option<Rect>, dst: Option<Rect>, angle: f64, center: Option<Point>, (flip_horizontal, flip_vertical): (bool, bool)) {
|
||||
let flip = match (flip_horizontal, flip_vertical) {
|
||||
(false, false) => ll::SDL_FLIP_NONE,
|
||||
(true, false) => ll::SDL_FLIP_HORIZONTAL,
|
||||
|
||||
Reference in New Issue
Block a user