diff options
Diffstat (limited to 'wgpu/src/renderer.rs')
-rw-r--r-- | wgpu/src/renderer.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs index 52764248..4199eee5 100644 --- a/wgpu/src/renderer.rs +++ b/wgpu/src/renderer.rs @@ -1,7 +1,7 @@ use crate::{quad, text, Image, Primitive, Quad, Transformation}; use iced_native::{ - renderer::Debugger, renderer::Windowed, Background, Color, Layout, - MouseCursor, Point, Rectangle, Vector, Widget, + renderer::{Debugger, Windowed}, + Background, Color, Layout, MouseCursor, Point, Rectangle, Vector, Widget, }; use wgpu::{ @@ -152,21 +152,21 @@ impl Renderer { vertical_alignment, } => { let x = match horizontal_alignment { - iced_native::text::HorizontalAlignment::Left => bounds.x, - iced_native::text::HorizontalAlignment::Center => { + iced_native::HorizontalAlignment::Left => bounds.x, + iced_native::HorizontalAlignment::Center => { bounds.x + bounds.width / 2.0 } - iced_native::text::HorizontalAlignment::Right => { + iced_native::HorizontalAlignment::Right => { bounds.x + bounds.width } }; let y = match vertical_alignment { - iced_native::text::VerticalAlignment::Top => bounds.y, - iced_native::text::VerticalAlignment::Center => { + iced_native::VerticalAlignment::Top => bounds.y, + iced_native::VerticalAlignment::Center => { bounds.y + bounds.height / 2.0 } - iced_native::text::VerticalAlignment::Bottom => { + iced_native::VerticalAlignment::Bottom => { bounds.y + bounds.height } }; @@ -183,24 +183,24 @@ impl Renderer { font_id: self.text_pipeline.find_font(*font), layout: wgpu_glyph::Layout::default() .h_align(match horizontal_alignment { - iced_native::text::HorizontalAlignment::Left => { + iced_native::HorizontalAlignment::Left => { wgpu_glyph::HorizontalAlign::Left } - iced_native::text::HorizontalAlignment::Center => { + iced_native::HorizontalAlignment::Center => { wgpu_glyph::HorizontalAlign::Center } - iced_native::text::HorizontalAlignment::Right => { + iced_native::HorizontalAlignment::Right => { wgpu_glyph::HorizontalAlign::Right } }) .v_align(match vertical_alignment { - iced_native::text::VerticalAlignment::Top => { + iced_native::VerticalAlignment::Top => { wgpu_glyph::VerticalAlign::Top } - iced_native::text::VerticalAlignment::Center => { + iced_native::VerticalAlignment::Center => { wgpu_glyph::VerticalAlign::Center } - iced_native::text::VerticalAlignment::Bottom => { + iced_native::VerticalAlignment::Bottom => { wgpu_glyph::VerticalAlign::Bottom } }), |