Conversation
|
The generated |
| .map(|pos| (*transform * (pos * rect_size).extend(1.)).xyz()); | ||
| let positions = QUAD_VERTEX_POSITIONS.map(|pos| { | ||
| (*transform | ||
| * Mat4::from_rotation_z(*rotation) |
There was a problem hiding this comment.
Should the rotation be flipped in flip_y is true?
ickshonpe
left a comment
There was a problem hiding this comment.
This misses what I was trying to do with #6688 and #9341 (to be fair part of the reason I gave up on those mostly because a lot of the reviewers misunderstood it too). We can already rotate UI content using Transform::from_rotation(Quat::from_rotation_z(angle)).
The problem though is that after rotation the content no longer fits inside the node's bounds. Those two PR's also recomputed the node's content size so the content would still fit inside the layout.
The main objections to those PRs were that:
- They didn't support arbitrary rotations, only right angles.
- The API was confusing using unfamiliar terms from group theory.
I don't disagree with them (the other reason I didn't update those PRs), but the UI renderer currently only supports clipping axis-aligned elements atm and you get confusing visual artifacts with clipping and rotation otherwise and I felt that support for axis-aligned transformations was better than nothing.
Maybe it's okay to support arbitrary rotations though and fix clipping later.
To be useful this needs to update the content sizes and image extraction would need to use the size of the image and not the size of the node.
Probably one of two things:
|
|
IIRC I did on the leaf... |
IIRC both of those PRs rotated the image by swapping around the UV coords which avoids any problems with clipping but only supports 90 degree rotations. I did implement clipping of rotated elements for a bevy 0.13 fork for work but the implementation was a bit limited and slow so I didn't upstream it. I've got an improved very WIP version that might be ready for 0.17. |
|
Reverted back to draft as there is things to consider
|
|
Cutting from the 0.17 milestone as this is not ready to ship. |

Objective
Adopt #6688
Allow rotation of
ImageNodesSolution
Replace
ImageNode::flip_xforrotation,ImageNode::flip_yremains intactTesting
testbed_full_ui,ui_texture_slice_flip_and_tileand newimage_node_rotationexamplesShowcase
Deliberate Rendering change
There have been changed to the
testbed_full_iuexampleTODO