marc2332 / freya

Cross-platform GUI library for 🦀 Rust powered by 🧬 Dioxus and 🎨 Skia.
https://freyaui.dev/
MIT License
1.33k stars 51 forks source link

bug: Opacity attribute prevents shadows rendering correctly. #762

Closed dload0 closed 1 month ago

dload0 commented 1 month ago

When having a similar setup to the code below, the shadow in the child element will not render.

rect {
    height: "100%",
    width: "100%",
    main_align: "center",
    cross_align: "center",

    opacity: "1", // <- `opacity` attribute in parent element will prevent shadows in child elements from being rendered.

    rect {
        width: "50",
        height: "50",
        background: "black",

        shadow: "0 0 10 5 rgb(0, 0, 0)",
    }
}

As well as this, applying an opacity attribute to the element itself with the shadow will have the same behaviour.

rect {
    width: "50",
    height: "50",
    background: "black",

    opacity: "1", // Will still render the component, however the shadow will not render.

    shadow: "0 0 10 5 rgb(0, 0, 0)",
}