summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-12 13:44:13 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-12 13:44:13 +0200
commit74a4ba65d6fea0c68dfbf721230c4abf36505e61 (patch)
tree13780adb724419d9aebc5f3d6a9e0ee56b0e3ed7 /wgpu
parent718fe5b7de6c705b1797c49d382182182acdbe80 (diff)
downloadiced-74a4ba65d6fea0c68dfbf721230c4abf36505e61.tar.gz
iced-74a4ba65d6fea0c68dfbf721230c4abf36505e61.tar.bz2
iced-74a4ba65d6fea0c68dfbf721230c4abf36505e61.zip
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.
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/shader/image.wgsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/wgpu/src/shader/image.wgsl b/wgpu/src/shader/image.wgsl
index accefc17..0eeb100f 100644
--- a/wgpu/src/shader/image.wgsl
+++ b/wgpu/src/shader/image.wgsl
@@ -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);