Align images to the pixel grid in iced_wgpu
This should fix some graphical glitches, at the expense of potential alignment issues with small icons / images.
This commit is contained in:
parent
718fe5b7de
commit
74a4ba65d6
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ fn vs_main(input: VertexInput) -> VertexOutput {
|
||||||
out.opacity = input.opacity;
|
out.opacity = input.opacity;
|
||||||
|
|
||||||
// Calculate the vertex position and move the center to the origin
|
// 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
|
// Apply the rotation around the center of the image
|
||||||
let cos_rot = cos(input.rotation);
|
let cos_rot = cos(input.rotation);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue