fix: text not working
This commit is contained in:
@@ -93,14 +93,14 @@ impl Text {
|
|||||||
let style =
|
let style =
|
||||||
self.style
|
self.style
|
||||||
.get_or_try_init(|| -> Result<SendWrapper<TextStyle>, anyhow::Error> {
|
.get_or_try_init(|| -> Result<SendWrapper<TextStyle>, anyhow::Error> {
|
||||||
let font = if let Some(path) = self.font_path.as_deref() {
|
let font = self
|
||||||
Font::from_file(sk, path)
|
.font_path
|
||||||
} else {
|
.as_deref()
|
||||||
Some(Font::default(sk))
|
.and_then(|path| Font::from_file(sk, path))
|
||||||
};
|
.unwrap_or(Font::default(sk));
|
||||||
Ok(SendWrapper::new(TextStyle::new(
|
Ok(SendWrapper::new(TextStyle::new(
|
||||||
sk,
|
sk,
|
||||||
font.ok_or(std::fmt::Error)?,
|
font,
|
||||||
1.0,
|
1.0,
|
||||||
Rgba::new(Rgb::new(1.0, 1.0, 1.0), 1.0),
|
Rgba::new(Rgb::new(1.0, 1.0, 1.0), 1.0),
|
||||||
)))
|
)))
|
||||||
|
|||||||
Reference in New Issue
Block a user