#2546·iced

Different widget types do not agree on how to align to pixel grid

Author: peterkrullCreated Aug 9, 2024Updated Sep 26, 2026
Labelsbug

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

I am currently using Cosmic, but I have also tested this on the latest iced master. I have noticed that various parts of the UI (in Cosmic) seem to "shimmer" or "wiggle", due to how different elements/widgets get rasterized. For example, text will always "jump" up or down one entire pixel at a time, but the quad of a button, will "smoothly" glide across pixels. Even a 1-pixel wide border on the quad will be able to sit between pixels, causing it to become become slightly blurred.

This is a video from Cosmic settings.

https://github.com/user-attachments/assets/4b87e56b-7b2a-4a78-b0e8-462747c63aef

And on the current Iced master, I am able to produce this:

https://github.com/user-attachments/assets/645b6e49-161d-4b2a-a05f-38b7d320a867

The border is supposed to have a 1px white border, but the sides are obviously 2px wide, and muted in color. Also the number of pixels between lines of text keep changing, instead of staying the same.

What is the expected behavior?

I would expect (or at least have the option to enforce) that everything is rendered aligned to the pixel grid. Such that a 1px border is only and always 1px on my monitor. Or that the distance between two lines of text are always x pixels when scrolling, instead of constantly swapping between x and 1+x pixel distance.

Essentially when scrolling a static page, I would like to have the contents be pixel-perfect identical, just shifted up or down by some number of pixels.

Version

master

Operating System

Linux

Do you have any log output?

No response