Feature Request: Image UV arbitrary quad
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Is your feature request related to a problem? Please describe.**
I'm working on an image cropping tool within a bigger app, where the user selects rectangles, and very well may rotate them. Somewhere next to the view of the full image, there is a preview of the crop, which means a view of the image mapped to the UVs selected by the user.
The road block is that `widgets::Image.uv(...)` takes a `Rect` which is by definition axis-aligned.
**Describe the solution you'd like**
I would appreciate something like a `.uv_exact(Pos2,Pos2,Pos2,Pos2)` method to select specific UVs.
**Describe alternatives you've considered**
- Doing the texture rotations myself
Means doing image processing and uploading new textures every time the user changes the rect's rotation and position, which is unacceptable overhead.
- Another cheaper option could be putting a rotated image into a clipping region, which would work, though feels like it requires more work than needed: **the renderer is going to be assigning images to a quad with four UV points anyway.**
**Additional context**
To illustrate that I'm not talking about image rotations:

Contributor guide
Research direction
Start by tracing widgets::Image.uv(...) and the renderer path it uses for image quads. Confirm how UV coordinates are currently passed and identify the API and rendering changes needed for four arbitrary Pos2 UV points. Done means callers can select an arbitrary UV quad without preprocessing or re-uploading rotated textures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100