Merge pull request #2440 from iced-rs/align-images-to-pixel-grid

Align images to the (logical) pixel grid in `iced_wgpu`
This commit is contained in:
Héctor Ramón 2024-05-12 13:55:05 +02:00 committed by GitHub
commit b30d34f728
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,7 +38,7 @@ fn vs_main(input: VertexInput) -> VertexOutput {
out.opacity = input.opacity;
// Calculate the vertex position and move the center to the origin
v_pos = input.pos + v_pos * input.scale - input.center;
v_pos = round(input.pos) + v_pos * input.scale - input.center;
// Apply the rotation around the center of the image
let cos_rot = cos(input.rotation);