Fix FontSystem::new_with_locale_and_db Signature
It turns out that the `no_std` version of `FontSystem::new_with_locale_and_db` doesn't match the `std` version. This fixes that.
This commit is contained in:
parent
521acb64e0
commit
71281a5d79
2 changed files with 6 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ use cosmic::{
|
||||||
mouse::{self, Button, Event as MouseEvent, ScrollDelta},
|
mouse::{self, Button, Event as MouseEvent, ScrollDelta},
|
||||||
renderer,
|
renderer,
|
||||||
widget::{self, tree, Widget},
|
widget::{self, tree, Widget},
|
||||||
Padding, {Color, Element, Length, Point, Rectangle, Shell, Size},
|
Color, Element, Length, Padding, Point, Rectangle, Shell, Size,
|
||||||
},
|
},
|
||||||
theme::{Theme, ThemeType},
|
theme::{Theme, ThemeType},
|
||||||
};
|
};
|
||||||
|
|
@ -227,7 +227,9 @@ where
|
||||||
|
|
||||||
// Scale metrics
|
// Scale metrics
|
||||||
let metrics = editor.buffer().metrics();
|
let metrics = editor.buffer().metrics();
|
||||||
editor.buffer_mut().set_metrics(metrics.scale(style.scale_factor as f32));
|
editor
|
||||||
|
.buffer_mut()
|
||||||
|
.set_metrics(metrics.scale(style.scale_factor as f32));
|
||||||
|
|
||||||
// Set size
|
// Set size
|
||||||
editor.buffer_mut().set_size(image_w as f32, image_h as f32);
|
editor.buffer_mut().set_size(image_w as f32, image_h as f32);
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,8 @@ impl FontSystem {
|
||||||
Self { locale, db }
|
Self { locale, db }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_with_locale_and_db(locale: &str, db: fontdb::Database) -> Self {
|
pub fn new_with_locale_and_db(locale: String, db: fontdb::Database) -> Self {
|
||||||
Self {
|
Self { locale, db }
|
||||||
locale: locale.to_string(),
|
|
||||||
db,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn locale(&self) -> &str {
|
pub fn locale(&self) -> &str {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue