Ditch the hot reloading approach
This commit is contained in:
parent
0bf607cd2d
commit
d6eaa3c6b8
14 changed files with 340 additions and 275 deletions
|
@ -3440,14 +3440,22 @@ impl<'a, 'b, 'c, V> LayoutContext<'a, 'b, 'c, V> {
|
|||
.unwrap_or(Arc::new(TextStyle::default(&self.font_cache)))
|
||||
}
|
||||
|
||||
pub fn push_text_style<S: Into<Arc<TextStyle>>>(&mut self, style: S) {
|
||||
self.text_style_stack.push(style.into());
|
||||
}
|
||||
|
||||
pub fn pop_text_style(&mut self) {
|
||||
self.text_style_stack.pop();
|
||||
}
|
||||
|
||||
pub fn with_text_style<S, F, T>(&mut self, style: S, f: F) -> T
|
||||
where
|
||||
S: Into<Arc<TextStyle>>,
|
||||
F: FnOnce(&mut Self) -> T,
|
||||
{
|
||||
self.text_style_stack.push(style.into());
|
||||
self.push_text_style(style);
|
||||
let result = f(self);
|
||||
self.text_style_stack.pop();
|
||||
self.pop_text_style();
|
||||
result
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ use serde_json::json;
|
|||
|
||||
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord, JsonSchema)]
|
||||
#[repr(transparent)]
|
||||
pub struct Color(#[schemars(with = "String")] ColorU);
|
||||
pub struct Color(#[schemars(with = "String")] pub ColorU);
|
||||
|
||||
pub fn color(rgba: u32) -> Color {
|
||||
Color::from_u32(rgba)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue