floem
floem copied to clipboard
Border radius is ignored when border is set individually
When the border is set individually via border_top etc and not via border the border radius is ignored.
use floem::{
peniko::Color,
view::View,
views::{label, Decorators},
};
fn app_view() -> impl View {
label(|| "text").style(|s| {
s.border_radius(15.0)
.border_left(20.0)
.border_top(20.0)
.width(200.0)
.height(100.0)
.margin(100.0)
.background(Color::RED)
.border_color(Color::BLUE)
})
}
fn main() {
floem::launch(app_view);
}
Yes, border radius for different border width has not been implemented yet. It's not easy to implement correctly.
https://drafts.csswg.org/css-backgrounds/#corner-shaping
https://github.com/lapce/floem/blob/04ee9e7c7786f1ab309b35287ec4a63574cbe9ae/src/view.rs#L466C4-L505C2
Issue appears to be here. Looks like we just need to swap in different kurbo shapes that can apply the border radius