From e75c2ff077f46395ef60cc4bc6d847b5a82b0468 Mon Sep 17 00:00:00 2001 From: guylamar2006 Date: Sun, 1 Dec 2024 09:47:58 -0600 Subject: [PATCH] Update piano_range.rs --- neothesia-iced-widgets/src/piano_range.rs | 28 ++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/neothesia-iced-widgets/src/piano_range.rs b/neothesia-iced-widgets/src/piano_range.rs index d05e325..f0ed99f 100644 --- a/neothesia-iced-widgets/src/piano_range.rs +++ b/neothesia-iced-widgets/src/piano_range.rs @@ -74,10 +74,16 @@ impl Widget for PianoRang renderer.fill_text( iced_core::text::Text { content: note_id, - position: iced_core::Point::new(bounds.x + (bounds.width / 2.0), bounds.y + (bounds.height / 2.0)), - color: iced_core::Color::BLACK, - ..Default::default() - } + bounds, + size: iced_core::Size::new(bounds.width, bounds.height), + font: Default::default(), + horizontal_alignment: iced_core::alignment::Horizontal::Center, + vertical_alignment: iced_core::alignment::Vertical::Center, + line_height: Default::default(), + }, + iced_core::Point::new(bounds.x + (bounds.width / 2.0), bounds.y + (bounds.height / 2.0)), + iced_core::Color::BLACK, + bounds ); } @@ -106,10 +112,16 @@ impl Widget for PianoRang renderer.fill_text( iced_core::text::Text { content: note_id, - position: iced_core::Point::new(bounds.x + (bounds.width / 2.0), bounds.y + (bounds.height / 2.0)), - color: iced_core::Color::WHITE, - ..Default::default() - } + bounds, + size: iced_core::Size::new(bounds.width, bounds.height), + font: Default::default(), + horizontal_alignment: iced_core::alignment::Horizontal::Center, + vertical_alignment: iced_core::alignment::Vertical::Center, + line_height: Default::default(), + }, + iced_core::Point::new(bounds.x + (bounds.width / 2.0), bounds.y + (bounds.height / 2.0)), + iced_core::Color::WHITE, + bounds ); } });