Skip to content

Commit 557ebeb

Browse files
committed
xstate/settings: Clamp scale to >=1
Avoids crashing, and GTK apps also seem to generally dislike when the reported DPI is less than the default. Fixes Supreeeme#181
1 parent ef24bce commit 557ebeb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/xstate/settings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ impl Settings {
164164
fn set_scale(&mut self, scale: f64) {
165165
self.serial += 1;
166166

167+
let scale = scale.max(1.0);
167168
let setting = IntSetting {
168169
value: (scale * DEFAULT_DPI as f64 * DPI_SCALE_FACTOR as f64).round() as i32,
169170
last_change_serial: self.serial,

0 commit comments

Comments
 (0)