feat: add fill_raw method and Raw associated type for text::Renderer

This commit is contained in:
pml68 2025-05-25 21:08:31 +02:00 committed by Héctor Ramón Jiménez
parent 6bbe189809
commit b26890f76e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
7 changed files with 49 additions and 4 deletions

View file

@ -5,7 +5,7 @@ use crate::core::{
};
use crate::graphics::damage;
use crate::graphics::layer;
use crate::graphics::text::{Editor, Paragraph, Text};
use crate::graphics::text::{Editor, Paragraph, Raw, Text};
use crate::graphics::{self, Image};
use std::sync::Arc;
@ -70,6 +70,15 @@ impl Layer {
self.text.push(Item::Live(editor));
}
pub fn draw_raw(&mut self, raw: Raw, transformation: Transformation) {
let raw = Text::Raw {
raw,
transformation,
};
self.text.push(Item::Live(raw));
}
pub fn draw_text(
&mut self,
text: core::Text,