Improve naming in layer modules
This commit is contained in:
parent
a0b409ed7e
commit
06f3472df5
4 changed files with 30 additions and 22 deletions
|
|
@ -5,7 +5,7 @@ use crate::core::{
|
|||
};
|
||||
use crate::graphics::damage;
|
||||
use crate::graphics::layer;
|
||||
use crate::graphics::text::{Editor, Paragraph, Raw, Text};
|
||||
use crate::graphics::text::{Editor, Paragraph, Text};
|
||||
use crate::graphics::{self, Image};
|
||||
|
||||
use std::sync::Arc;
|
||||
|
|
@ -70,15 +70,6 @@ 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,
|
||||
|
|
@ -104,6 +95,19 @@ impl Layer {
|
|||
self.text.push(Item::Live(text));
|
||||
}
|
||||
|
||||
pub fn draw_text_raw(
|
||||
&mut self,
|
||||
raw: graphics::text::Raw,
|
||||
transformation: Transformation,
|
||||
) {
|
||||
let raw = Text::Raw {
|
||||
raw,
|
||||
transformation,
|
||||
};
|
||||
|
||||
self.text.push(Item::Live(raw));
|
||||
}
|
||||
|
||||
pub fn draw_text_group(
|
||||
&mut self,
|
||||
text: Vec<Text>,
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ impl core::text::Renderer for Renderer {
|
|||
impl graphics::text::Renderer for Renderer {
|
||||
fn fill_raw(&mut self, raw: graphics::text::Raw) {
|
||||
let (layer, transformation) = self.layers.current_mut();
|
||||
layer.draw_raw(raw, transformation);
|
||||
layer.draw_text_raw(raw, transformation);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::graphics;
|
|||
use crate::graphics::Mesh;
|
||||
use crate::graphics::color;
|
||||
use crate::graphics::layer;
|
||||
use crate::graphics::text::{Editor, Paragraph, Raw};
|
||||
use crate::graphics::text::{Editor, Paragraph};
|
||||
use crate::image::{self, Image};
|
||||
use crate::primitive::{self, Primitive};
|
||||
use crate::quad::{self, Quad};
|
||||
|
|
@ -101,15 +101,6 @@ impl Layer {
|
|||
self.pending_text.push(editor);
|
||||
}
|
||||
|
||||
pub fn draw_raw(&mut self, raw: Raw, transformation: Transformation) {
|
||||
let raw = Text::Raw {
|
||||
raw,
|
||||
transformation,
|
||||
};
|
||||
|
||||
self.pending_text.push(raw);
|
||||
}
|
||||
|
||||
pub fn draw_text(
|
||||
&mut self,
|
||||
text: crate::core::Text,
|
||||
|
|
@ -135,6 +126,19 @@ impl Layer {
|
|||
self.pending_text.push(text);
|
||||
}
|
||||
|
||||
pub fn draw_text_raw(
|
||||
&mut self,
|
||||
raw: graphics::text::Raw,
|
||||
transformation: Transformation,
|
||||
) {
|
||||
let raw = Text::Raw {
|
||||
raw,
|
||||
transformation,
|
||||
};
|
||||
|
||||
self.pending_text.push(raw);
|
||||
}
|
||||
|
||||
pub fn draw_image(&mut self, image: Image, transformation: Transformation) {
|
||||
match image {
|
||||
Image::Raster {
|
||||
|
|
|
|||
|
|
@ -775,7 +775,7 @@ impl core::text::Renderer for Renderer {
|
|||
impl graphics::text::Renderer for Renderer {
|
||||
fn fill_raw(&mut self, raw: graphics::text::Raw) {
|
||||
let (layer, transformation) = self.layers.current_mut();
|
||||
layer.draw_raw(raw, transformation);
|
||||
layer.draw_text_raw(raw, transformation);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue