mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Add Rust API for build.rs to specify the scale factor ahead of time
This commit is contained in:
parent
a727d87796
commit
18d6d2da29
1 changed files with 11 additions and 0 deletions
|
@ -162,6 +162,17 @@ impl CompilerConfiguration {
|
|||
};
|
||||
Self { config }
|
||||
}
|
||||
|
||||
/// Sets the scale factor to be applied to all `px` to `phx` conversions
|
||||
/// as constant value. This is only intended for MCU environments. Use
|
||||
/// in combination with [`Self::embed_resources`] to pre-scale images and glyphs
|
||||
/// accordingly.
|
||||
#[must_use]
|
||||
pub fn with_scale_factor(self, factor: f32) -> Self {
|
||||
let mut config = self.config;
|
||||
config.const_scale_factor = factor as f64;
|
||||
Self { config }
|
||||
}
|
||||
}
|
||||
|
||||
/// Error returned by the `compile` function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue