summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wgpu/src/layer.rs15
-rw-r--r--wgpu/src/layer/text.rs8
2 files changed, 21 insertions, 2 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 7a5a0f7c..10b3332d 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -120,12 +120,25 @@ impl<'a> Layer<'a> {
} => {
let layer = &mut layers[current_layer];
- layer.text.push(Text::Managed {
+ layer.text.push(Text::Paragraph {
paragraph: paragraph.clone(),
position: *position + translation,
color: *color,
});
}
+ Primitive::Editor {
+ editor,
+ position,
+ color,
+ } => {
+ let layer = &mut layers[current_layer];
+
+ layer.text.push(Text::Editor {
+ editor: editor.clone(),
+ position: *position + translation,
+ color: *color,
+ });
+ }
Primitive::Text {
content,
bounds,
diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs
index b61615d6..d46b39da 100644
--- a/wgpu/src/layer/text.rs
+++ b/wgpu/src/layer/text.rs
@@ -1,16 +1,22 @@
use crate::core::alignment;
use crate::core::text;
use crate::core::{Color, Font, Pixels, Point, Rectangle};
+use crate::graphics::text::editor;
use crate::graphics::text::paragraph;
/// A paragraph of text.
#[derive(Debug, Clone)]
pub enum Text<'a> {
- Managed {
+ Paragraph {
paragraph: paragraph::Weak,
position: Point,
color: Color,
},
+ Editor {
+ editor: editor::Weak,
+ position: Point,
+ color: Color,
+ },
Cached(Cached<'a>),
}