question overlays work :)

This commit is contained in:
Dominic 2024-05-25 16:20:43 +02:00
parent 8b57b97c80
commit b11baf1358
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D
6 changed files with 218 additions and 31 deletions

View file

@ -13,7 +13,7 @@ pub(crate) struct Question {
}
impl Question {
pub(crate) fn new(res: Resolution, lang: &Language<'_>, str: String) -> Self {
pub(crate) fn new(res: Resolution, lang: &Language<'_>, str: &str) -> Self {
static FONT: OnceLock<Owned<Font<'static>>> = OnceLock::new();
let font = FONT.get_or_init(|| {
let fc = Fontconfig::new().unwrap();
@ -134,14 +134,6 @@ impl Question {
svg.set_width(self.res.width());
svg.set_height(self.res.height());
svg.set_view_box("0 0 1920 1080");
svg.push(
Rect::new()
.with_fill("#040")
.with_x(0)
.with_y(0)
.with_width(1920)
.with_height(1080)
);
svg.push(self.g);
svg
}