diff --git a/src/outputs.rs b/src/outputs.rs index 22de38c5..a6a8944d 100644 --- a/src/outputs.rs +++ b/src/outputs.rs @@ -313,8 +313,8 @@ pub type PixelSize = Size; /// wl_output mode #[derive(Clone, Copy, Debug)] pub struct Mode { - width: i32, - height: i32, + pub width: i32, + pub height: i32, } #[derive(Clone, Copy, Debug)] diff --git a/src/state.rs b/src/state.rs index f3fbe91a..d5d4437a 100644 --- a/src/state.rs +++ b/src/state.rs @@ -566,4 +566,29 @@ pub mod test { ); } + + #[test] + fn size_l5() { + use crate::outputs::{Mode, Geometry, c, Size}; + assert_eq!( + Application::get_preferred_height(&OutputState { + current_mode: Some(Mode { + width: 720, + height: 1440, + }), + geometry: Some(Geometry{ + transform: c::Transform::Normal, + phys_size: Size { + width: Some(Millimeter(65)), + height: Some(Millimeter(130)), + }, + }), + scale: 2, + }), + Some(PixelSize { + scale_factor: 2, + pixels: 420, + }), + ); + } }