diff --git a/neothesia-iced-widgets/src/piano_range.rs b/neothesia-iced-widgets/src/piano_range.rs index f0ed99f..c61ed4b 100644 --- a/neothesia-iced-widgets/src/piano_range.rs +++ b/neothesia-iced-widgets/src/piano_range.rs @@ -3,12 +3,15 @@ use iced_core::{ renderer::Quad, Background, Color, Length, Rectangle, Size, Theme, Vector, Widget, text::Renderer as TextRenderer, - Text + Pixels }; pub struct PianoRange(pub std::ops::RangeInclusive); -impl Widget for PianoRange { +impl Widget for PianoRange +where + ::Font: std::default::Default, +{ fn size(&self) -> Size { Size { width: iced_core::Length::Fill, @@ -74,12 +77,14 @@ impl Widget for PianoRang renderer.fill_text( iced_core::text::Text { content: note_id, - bounds, - size: iced_core::Size::new(bounds.width, bounds.height), + bounds: iced_core::Size::new(bounds.width, bounds.height), + size: iced_core::Pixels(16.0), font: Default::default(), horizontal_alignment: iced_core::alignment::Horizontal::Center, vertical_alignment: iced_core::alignment::Vertical::Center, - line_height: Default::default(), + line_height: iced_core::Pixels(20.0), + shaping: iced_core::text::Shaping::Basic, + wrapping: iced_core::text::Wrapping::NoWrap, }, iced_core::Point::new(bounds.x + (bounds.width / 2.0), bounds.y + (bounds.height / 2.0)), iced_core::Color::BLACK, @@ -112,12 +117,14 @@ impl Widget for PianoRang renderer.fill_text( iced_core::text::Text { content: note_id, - bounds, - size: iced_core::Size::new(bounds.width, bounds.height), + bounds: iced_core::Size::new(bounds.width, bounds.height), + size: iced_core::Pixels(16.0), font: Default::default(), horizontal_alignment: iced_core::alignment::Horizontal::Center, vertical_alignment: iced_core::alignment::Vertical::Center, - line_height: Default::default(), + line_height: iced_core::Pixels(20.0), + shaping: iced_core::text::Shaping::Basic, + wrapping: iced_core::text::Wrapping::NoWrap, }, iced_core::Point::new(bounds.x + (bounds.width / 2.0), bounds.y + (bounds.height / 2.0)), iced_core::Color::WHITE,