Implement fill_raw
This commit is contained in:
parent
90c0aefa25
commit
a926290efb
4 changed files with 17 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
@ -128,6 +128,15 @@ impl Layer {
|
|||
.push(Item::Cached(text, clip_bounds, transformation));
|
||||
}
|
||||
|
||||
pub fn draw_raw(&mut self, raw: Raw, transformation: Transformation) {
|
||||
let text = Text::Raw {
|
||||
raw,
|
||||
transformation,
|
||||
};
|
||||
|
||||
self.text.push(Item::Live(text));
|
||||
}
|
||||
|
||||
pub fn draw_image(&mut self, image: Image, transformation: Transformation) {
|
||||
match image {
|
||||
Image::Raster {
|
||||
|
|
|
|||
|
|
@ -309,7 +309,10 @@ impl core::text::Renderer for Renderer {
|
|||
layer.draw_text(text, position, color, clip_bounds, transformation);
|
||||
}
|
||||
|
||||
fn fill_raw(&mut self, _raw: Self::Raw) {}
|
||||
fn fill_raw(&mut self, raw: Self::Raw) {
|
||||
let (layer, transformation) = self.layers.current_mut();
|
||||
layer.draw_raw(raw, transformation);
|
||||
}
|
||||
}
|
||||
|
||||
impl graphics::text::Renderer for Renderer {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue