MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / test_visual_rotation_flip_only

Function test_visual_rotation_flip_only

src/lib.rs:2048–2072  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls 9

beginMethod · 0.80
rotate_visualMethod · 0.80
background_colorMethod · 0.80
heightMethod · 0.80
elementMethod · 0.80
flip_xMethod · 0.80
evalMethod · 0.80
emptyMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected