Replace Raw in core::text::Renderer with a new Renderer trait
This commit is contained in:
parent
4ea0db665f
commit
a0b409ed7e
6 changed files with 33 additions and 29 deletions
|
|
@ -65,7 +65,7 @@ use crate::core::renderer;
|
|||
use crate::core::{
|
||||
Background, Color, Font, Pixels, Point, Rectangle, Size, Transformation,
|
||||
};
|
||||
use crate::graphics::text::{Editor, Paragraph, Raw};
|
||||
use crate::graphics::text::{Editor, Paragraph};
|
||||
use crate::graphics::{Shell, Viewport};
|
||||
|
||||
/// A [`wgpu`] graphics renderer for [`iced`].
|
||||
|
|
@ -717,7 +717,6 @@ impl core::text::Renderer for Renderer {
|
|||
type Font = Font;
|
||||
type Paragraph = Paragraph;
|
||||
type Editor = Editor;
|
||||
type Raw = Raw;
|
||||
|
||||
const ICON_FONT: Font = Font::with_name("Iced-Icons");
|
||||
const CHECKMARK_ICON: char = '\u{f00c}';
|
||||
|
|
@ -761,11 +760,6 @@ impl core::text::Renderer for Renderer {
|
|||
layer.draw_editor(editor, position, color, clip_bounds, transformation);
|
||||
}
|
||||
|
||||
fn fill_raw(&mut self, raw: Self::Raw) {
|
||||
let (layer, transformation) = self.layers.current_mut();
|
||||
layer.draw_raw(raw, transformation);
|
||||
}
|
||||
|
||||
fn fill_text(
|
||||
&mut self,
|
||||
text: core::Text,
|
||||
|
|
@ -778,6 +772,13 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "image")]
|
||||
impl core::image::Renderer for Renderer {
|
||||
type Handle = core::image::Handle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue