Use f32 for scale_factor
This commit is contained in:
parent
ad0e4c53cf
commit
74b792b608
14 changed files with 56 additions and 51 deletions
|
|
@ -26,7 +26,7 @@ struct Example {
|
|||
struct Window {
|
||||
title: String,
|
||||
scale_input: String,
|
||||
current_scale: f64,
|
||||
current_scale: f32,
|
||||
theme: Theme,
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ impl Example {
|
|||
Message::ScaleChanged(id, scale) => {
|
||||
if let Some(window) = self.windows.get_mut(&id) {
|
||||
window.current_scale = scale
|
||||
.parse::<f64>()
|
||||
.parse()
|
||||
.unwrap_or(window.current_scale)
|
||||
.clamp(0.5, 5.0);
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ impl Example {
|
|||
}
|
||||
}
|
||||
|
||||
fn scale_factor(&self, window: window::Id) -> f64 {
|
||||
fn scale_factor(&self, window: window::Id) -> f32 {
|
||||
self.windows
|
||||
.get(&window)
|
||||
.map(|window| window.current_scale)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue