atagen

monolith

public
Star0
Watch0

Commit 89dad88fda98

tarball

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

1 file changed+6-8
cursor: always stretch the theme image to the requested size

At scale 1 the nearest theme image was drawn as is, 32 px for a size of 24, while every other scale stretched exactly, so the cursor changed size crossing between outputs.
Modified file: crates/monolith/src/cursor.rs+6 additions−8 deletions
@@ -91,8 +91,7 @@ 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 scale 1 it is drawn
95- /// as the theme has it.
94+ /// exactly that size so it covers whole pixels.
9695 fn sized(
9796 &mut self,
9897 renderer: &mut VulkanRenderer,
@@ -106,12 +105,11 @@ impl Cursor {
106105 .file(icon)
107106 .and_then(|images| images.iter().min_by_key(|i| i.size.abs_diff(wanted)))
108107 .and_then(|image| {
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)
108+ prepare(
109+ renderer,
110+ image,
111+ f64::from(wanted) / f64::from(image.size.max(1)),
112+ )
115113 });
116114 self.sized.insert(key, prepared);
117115 }