atagen

monolith

public
Star0
Watch0

Commit 7da2bbb2037d

tarball

atagen <boss@atagen.co>2026-10-19 08:44 UTC

1 file changed+8-6
cursor: draw theme images as stored at scale 1

Stretching to exactly cursor size times scale changed what an output at scale 1 showed whenever the theme lacked the exact size. Only scaled outputs need the resample to cover whole pixels.
Modified file: crates/monolith/src/cursor.rs+8 additions−6 deletions
@@ -91,7 +91,8 @@ impl Cursor {
9191 }
9292
9393 /// The theme's image nearest the cursor size times `scale`, stretched to
94- /// exactly that size so it covers whole pixels at any scale.
94+ /// exactly that size so it covers whole pixels. At scale 1 it is drawn
95+ /// as the theme has it.
9596 fn sized(
9697 &mut self,
9798 renderer: &mut VulkanRenderer,
@@ -105,11 +106,12 @@ impl Cursor {
105106 .file(icon)
106107 .and_then(|images| images.iter().min_by_key(|i| i.size.abs_diff(wanted)))
107108 .and_then(|image| {
108- prepare(
109- renderer,
110- image,
111- f64::from(wanted) / f64::from(image.size.max(1)),
112- )
109+ let ratio = if scale == 1.0 {
110+ 1.0
111+ } else {
112+ f64::from(wanted) / f64::from(image.size.max(1))
113+ };
114+ prepare(renderer, image, ratio)
113115 });
114116 self.sized.insert(key, prepared);
115117 }