Implement fill_raw
This commit is contained in:
parent
90c0aefa25
commit
a926290efb
4 changed files with 17 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ tester = ["iced/tester"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
iced.workspace = true
|
iced.workspace = true
|
||||||
iced.features = ["tokio", "debug", "time-travel", "winit"]
|
iced.features = ["tokio", "debug", "time-travel", "winit", "wgpu"]
|
||||||
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use crate::core::{
|
||||||
};
|
};
|
||||||
use crate::graphics::damage;
|
use crate::graphics::damage;
|
||||||
use crate::graphics::layer;
|
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 crate::graphics::{self, Image};
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
@ -128,6 +128,15 @@ impl Layer {
|
||||||
.push(Item::Cached(text, clip_bounds, transformation));
|
.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) {
|
pub fn draw_image(&mut self, image: Image, transformation: Transformation) {
|
||||||
match image {
|
match image {
|
||||||
Image::Raster {
|
Image::Raster {
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,10 @@ impl core::text::Renderer for Renderer {
|
||||||
layer.draw_text(text, position, color, clip_bounds, transformation);
|
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 {
|
impl graphics::text::Renderer for Renderer {
|
||||||
|
|
|
||||||
|
|
@ -824,7 +824,8 @@ impl core::text::Renderer for Renderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fill_raw(&mut self, raw: Self::Raw) {
|
fn fill_raw(&mut self, raw: Self::Raw) {
|
||||||
// TODO
|
let (layer, transformation) = self.layers.current_mut();
|
||||||
|
layer.draw_text_raw(raw, transformation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue