feat: default to FilterMethod::Nearest on small image

helps make pixelart sharp without the need to change it yourself
This commit is contained in:
electria 2026-07-30 22:54:56 -07:00
commit c96a1cbdd1
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -164,6 +164,9 @@ impl State {
image.width(), image.width(),
image.height(), image.height(),
)); ));
if image.dimensions() < (100, 100) {
self.image_filter = widget::image::FilterMethod::Nearest;
}
self.image = Some(image); self.image = Some(image);
self.allocate_image() self.allocate_image()
}) })