diff options
Diffstat (limited to 'wgpu/src/renderer/text.rs')
-rw-r--r-- | wgpu/src/renderer/text.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/wgpu/src/renderer/text.rs b/wgpu/src/renderer/text.rs index 61349533..8fbade4e 100644 --- a/wgpu/src/renderer/text.rs +++ b/wgpu/src/renderer/text.rs @@ -1,5 +1,5 @@ use crate::{Primitive, Renderer}; -use iced_native::{text, Color, Layout, Node, Style, Text}; +use iced_native::{text, Color, Layout, MouseCursor, Node, Style, Text}; use wgpu_glyph::{GlyphCruncher, Section}; @@ -68,13 +68,16 @@ impl text::Renderer for Renderer { } fn draw(&mut self, text: &Text, layout: Layout<'_>) -> Self::Output { - Primitive::Text { - content: text.content.clone(), - size: f32::from(text.size.unwrap_or(20)), - bounds: layout.bounds(), - color: text.color.unwrap_or(Color::BLACK), - horizontal_alignment: text.horizontal_alignment, - vertical_alignment: text.vertical_alignment, - } + ( + Primitive::Text { + content: text.content.clone(), + size: f32::from(text.size.unwrap_or(20)), + bounds: layout.bounds(), + color: text.color.unwrap_or(Color::BLACK), + horizontal_alignment: text.horizontal_alignment, + vertical_alignment: text.vertical_alignment, + }, + MouseCursor::OutOfBounds, + ) } } |