From 8c3997d795e338f2732d0e3ff63e96af12155c38 Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Wed, 6 Nov 2024 17:45:38 +0800 Subject: [PATCH] divider: Make the size flexible (#397) --- crates/ui/src/divider.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/ui/src/divider.rs b/crates/ui/src/divider.rs index 9a049981..15056166 100644 --- a/crates/ui/src/divider.rs +++ b/crates/ui/src/divider.rs @@ -16,7 +16,7 @@ pub struct Divider { impl Divider { pub fn vertical() -> Self { Self { - base: div(), + base: div().h_full(), axis: Axis::Vertical, label: None, } @@ -24,7 +24,7 @@ impl Divider { pub fn horizontal() -> Self { Self { - base: div(), + base: div().w_full(), axis: Axis::Horizontal, label: None, } @@ -51,10 +51,6 @@ impl RenderOnce for Divider { .flex_shrink_0() .items_center() .justify_center() - .map(|this| match self.axis { - Axis::Vertical => this.h_full(), - Axis::Horizontal => this.w_full(), - }) .child( div() .absolute()