diff --git a/apps/vectorcraft/src/window_frame.rs b/apps/vectorcraft/src/window_frame.rs index fb62a91eac..8f92ffbe44 100644 --- a/apps/vectorcraft/src/window_frame.rs +++ b/apps/vectorcraft/src/window_frame.rs @@ -481,7 +481,11 @@ mod tests { let (monitor, work) = ((0, 0, 3840, 2160), (0, 0, 3840, 2000)); let rect = (-40, -40, 3880, 2200); assert_eq!(clamped_rect(rect, monitor, work), None, "100 %"); - assert_eq!(super::clamped_rect(rect, monitor, work, frame_limit(480)), Some((-40, -40, 3880, 2040)), "500 %"); + let Some(clamped) = super::clamped_rect(rect, monitor, work, frame_limit(480)) else { + panic!("500 %: the maximized frame is not clamped"); + }; + assert_eq!((clamped.0, clamped.1, clamped.2), (rect.0, rect.1, rect.2), "500 %: only the bottom edge moves"); + assert_eq!(clamped.3 - work.3, monitor.1 - rect.1, "500 %: the bottom border hangs below the work area as the top one above the monitor"); assert_eq!(super::clamped_rect((-8, -8, 1928 + 40, 1088), (0, 0, 1920, 1080), (0, 0, 1920, 1046), frame_limit(96)), None, "past the limit"); assert_eq!(frame_limit(0), frame_limit(96), "an unknown DPI counts as 100 %"); assert!(frame_limit(u32::MAX) > frame_limit(480), "no overflow");