Skip to content

Commit

Permalink
Merge pull request #2440 from iced-rs/align-images-to-pixel-grid
Browse files Browse the repository at this point in the history
Align images to the (logical) pixel grid in `iced_wgpu`
  • Loading branch information
hecrj authored May 12, 2024
2 parents fa458a3 + 74a4ba6 commit b30d34f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wgpu/src/shader/image.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b30d34f

Please sign in to comment.