Improve naming in layer modules

This commit is contained in:
Héctor Ramón Jiménez 2025-11-26 00:45:07 +01:00
parent a0b409ed7e
commit 06f3472df5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 30 additions and 22 deletions

View file

@ -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>,

View file

@ -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);
}
}

View file

@ -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 {

View file

@ -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);
}
}