summaryrefslogtreecommitdiffstats
path: root/examples/custom_shader
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-07-12 21:40:46 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-12 21:40:46 +0200
commit8cadd3b99485c344feb18b774c8e6fd6c1ea9dd7 (patch)
tree826fa9e0acdf3a4e003f882c94ff24a4ac9f50e4 /examples/custom_shader
parentbe06060117da061ad8cad94ab0830c06def6b147 (diff)
parent3f480d3d18c41188bf40ead0a3dc4497316f11ae (diff)
downloadiced-8cadd3b99485c344feb18b774c8e6fd6c1ea9dd7.tar.gz
iced-8cadd3b99485c344feb18b774c8e6fd6c1ea9dd7.tar.bz2
iced-8cadd3b99485c344feb18b774c8e6fd6c1ea9dd7.zip
Merge pull request #2504 from iced-rs/view-ergonomics
Improved `view` ergonomics
Diffstat (limited to 'examples/custom_shader')
-rw-r--r--examples/custom_shader/src/main.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/custom_shader/src/main.rs b/examples/custom_shader/src/main.rs
index b04a8183..5886f6bb 100644
--- a/examples/custom_shader/src/main.rs
+++ b/examples/custom_shader/src/main.rs
@@ -6,7 +6,7 @@ use iced::time::Instant;
use iced::widget::shader::wgpu;
use iced::widget::{center, checkbox, column, row, shader, slider, text};
use iced::window;
-use iced::{Alignment, Color, Element, Length, Subscription};
+use iced::{Center, Color, Element, Fill, Subscription};
fn main() -> iced::Result {
iced::application(
@@ -122,12 +122,11 @@ impl IcedCubes {
let controls = column![top_controls, bottom_controls,]
.spacing(10)
.padding(20)
- .align_items(Alignment::Center);
+ .align_x(Center);
- let shader =
- shader(&self.scene).width(Length::Fill).height(Length::Fill);
+ let shader = shader(&self.scene).width(Fill).height(Fill);
- center(column![shader, controls].align_items(Alignment::Center)).into()
+ center(column![shader, controls].align_x(Center)).into()
}
fn subscription(&self) -> Subscription<Message> {