()
| 2046 | #[rustfmt::skip] |
| 2047 | #[test] |
| 2048 | fn test_visual_rotation_flip_only() { |
| 2049 | let mut ply = Ply::<()>::new_headless(Dimensions::new(800.0, 600.0)); |
| 2050 | let mut ui = ply.begin(); |
| 2051 | |
| 2052 | // 0° but flip_x — NOT a noop, should emit group |
| 2053 | ui.element() |
| 2054 | .width(fixed!(100.0)).height(fixed!(100.0)) |
| 2055 | .background_color(0xFF0000) |
| 2056 | .rotate_visual(|r| r.flip_x()) |
| 2057 | .empty(); |
| 2058 | |
| 2059 | let items = ui.eval(); |
| 2060 | |
| 2061 | // GroupBegin, Rectangle, GroupEnd |
| 2062 | assert_eq!(items.len(), 3, "Flip-only should produce 3 items, got {}", items.len()); |
| 2063 | match &items[0].config { |
| 2064 | render_commands::RenderCommandConfig::GroupBegin { visual_rotation, .. } => { |
| 2065 | let vr = visual_rotation.as_ref().expect("Should have rotation config"); |
| 2066 | assert!(vr.flip_x); |
| 2067 | assert!(!vr.flip_y); |
| 2068 | assert_eq!(vr.rotation_radians, 0.0); |
| 2069 | } |
| 2070 | other => panic!("Expected GroupBegin, got {:?}", other), |
| 2071 | } |
| 2072 | } |
| 2073 | |
| 2074 | #[rustfmt::skip] |
| 2075 | #[test] |
nothing calls this directly
no test coverage detected