Files
solidcraft-upstream/crates/ui-egui/tests/scenarios/s39_view_cube_hover.json
T

32 lines
2.0 KiB
JSON

[
{"note": "The view cube is a cube with chamfered corners. Its targets are the 6 faces, the 12 edges (a band along each edge, on both faces it joins) and the 8 corner facets; hover lights exactly the one under the pointer, and a click turns the view to it."},
{"call": "ui.view", "params": {"view": "home"}},
{"move": {"cube": [0, 0, 1]}},
{"expect": {"count": {"name": "cube_highlights", "value": 1}, "shown_handles": ["cube_hover:top"]}},
{"move": {"cube": [0.3, -1, 0.2]}},
{"expect": {"count": {"name": "cube_highlights", "value": 1}, "shown_handles": ["cube_hover:front"]}},
{"note": "On the top-front edge, and just off it on the top face: the edge."},
{"move": {"cube": [0, -1, 1]}},
{"expect": {"count": {"name": "cube_highlights", "value": 1}, "shown_handles": ["cube_hover:top-front"]}},
{"move": {"cube": [0, -0.9, 1]}},
{"expect": {"count": {"name": "cube_highlights", "value": 1}, "shown_handles": ["cube_hover:top-front"]}},
{"move": {"cube": [0.873, -0.873, 0.873]}},
{"expect": {"count": {"name": "cube_highlights", "value": 1}, "shown_handles": ["cube_hover:top-front-right"]}},
{"click": {"handle": "cube:top-front-right"}},
{"expect": {"camera": {"yaw_deg": -45, "pitch_deg": 35.26}}},
{"click": {"handle": "cube:front"}},
{"expect": {"camera": {"yaw_deg": 0, "pitch_deg": 0}}},
{"note": "Looking straight at FRONT, its top edge is a band along the face's top: it turns to the view halfway between FRONT and TOP."},
{"move": {"cube": [0, -1, 0.95]}},
{"expect": {"count": {"name": "cube_highlights", "value": 1}, "shown_handles": ["cube_hover:top-front"]}},
{"click": {"handle": "cube:top-front"}},
{"expect": {"camera": {"yaw_deg": 0, "pitch_deg": 45}}},
{"click": {"handle": "cube:front-right"}},
{"expect": {"camera": {"yaw_deg": -45, "pitch_deg": 0}}},
{"call": "ui.view", "params": {"view": "home"}},
{"click": {"handle": "cube:top-back-right"}},
{"expect": {"camera": {"yaw_deg": -135, "pitch_deg": 35.26}}},
{"move": [800, 500]},
{"expect": {"count": {"name": "cube_highlights", "value": 0}}}
]