diff --git a/CHANGELOG.md b/CHANGELOG.md index 81eda76..7feaa88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - `X11Surface` now has an explicit `submit` function - `X11Surface` is now multi-window capable. - `Renderer::clear` now expects a second argument to optionally only clear parts of the buffer/surface +- `Transform::transform_size` now takes a `Size` instead of two `u32` ### Additions diff --git a/src/backend/renderer/mod.rs b/src/backend/renderer/mod.rs index f2c8ee6..2711e22 100644 --- a/src/backend/renderer/mod.rs +++ b/src/backend/renderer/mod.rs @@ -10,7 +10,7 @@ use std::collections::HashSet; use std::error::Error; -use crate::utils::{Buffer, Physical, Point, Rectangle, Size}; +use crate::utils::{Buffer, Coordinate, Physical, Point, Rectangle, Size}; #[cfg(feature = "wayland_frontend")] use crate::wayland::compositor::SurfaceData; @@ -94,15 +94,15 @@ impl Transform { } /// Transformed size after applying this transformation. - pub fn transform_size(&self, width: u32, height: u32) -> (u32, u32) { + pub fn transform_size(&self, size: Size) -> Size { if *self == Transform::_90 || *self == Transform::_270 || *self == Transform::Flipped90 || *self == Transform::Flipped270 { - (height, width) + (size.h, size.w).into() } else { - (width, height) + size } } }