()
| 2094 | #[rustfmt::skip] |
| 2095 | #[test] |
| 2096 | fn test_visual_rotation_config_values() { |
| 2097 | let mut ply = Ply::<()>::new_headless(Dimensions::new(800.0, 600.0)); |
| 2098 | let mut ui = ply.begin(); |
| 2099 | |
| 2100 | ui.element() |
| 2101 | .width(fixed!(100.0)).height(fixed!(100.0)) |
| 2102 | .background_color(0xFF0000) |
| 2103 | .rotate_visual(|r| r |
| 2104 | .radians(std::f32::consts::FRAC_PI_2) |
| 2105 | .pivot((0.25, 0.75)) |
| 2106 | .flip_x() |
| 2107 | .flip_y() |
| 2108 | ) |
| 2109 | .empty(); |
| 2110 | |
| 2111 | let items = ui.eval(); |
| 2112 | |
| 2113 | match &items[0].config { |
| 2114 | render_commands::RenderCommandConfig::GroupBegin { visual_rotation, .. } => { |
| 2115 | let vr = visual_rotation.as_ref().unwrap(); |
| 2116 | assert!((vr.rotation_radians - std::f32::consts::FRAC_PI_2).abs() < 0.001); |
| 2117 | assert_eq!(vr.pivot_x, 0.25); |
| 2118 | assert_eq!(vr.pivot_y, 0.75); |
| 2119 | assert!(vr.flip_x); |
| 2120 | assert!(vr.flip_y); |
| 2121 | } |
| 2122 | other => panic!("Expected GroupBegin, got {:?}", other), |
| 2123 | } |
| 2124 | } |
| 2125 | |
| 2126 | #[rustfmt::skip] |
| 2127 | #[test] |
nothing calls this directly
no test coverage detected