Skip to content

Images don't render past an X number of different images in a single stack #832

@p-yukusai

Description

@p-yukusai

I'm trying to get a bunch of images into one stack to use them as logos for buttons but they refuse to render past X number of instances depending on the image format.

Code example (excuse the indenting, GitHub isn't great at conserving it):

pub fn main_menu() -> impl IntoView {
    let logo= include_bytes!("./assets/logo.png");
    let logo2= include_bytes!("./assets/logo2.png");
    let logo3 = include_bytes!("./assets/logo3.png");
    let logo4= include_bytes!("./assets/logo4.png");
    
    h_stack((
        v_stack((
            h_stack((
                img(move || logo.to_vec()).style(|s| s
                    .aspect_ratio(1.0)
                    .size(32, 32)),
                label(||"Test1").style(|s| s.selectable(false)),
            )),
            h_stack((
                img(move || logo2.to_vec()).style(|s| s
                    .aspect_ratio(1.0)
                    .size(32, 32)),
                label(||" Test2"),
            )).style(|s| s.items_center().justify_center()),
        )).style(|s| s.padding_right(40)),
        v_stack((
            h_stack((
                img(move ||logo3.into()).style(|s| s
                    .aspect_ratio(1.0)
                    .size(32, 32)),
                label(||"Test3"),
            )).style(|s| s.items_center().justify_center().margin_bottom(120)),
            h_stack((
                img(move ||logo4.to_vec()).style(|s| s
                    .aspect_ratio(1.0)
                    .size(32, 32)),
                label(||" Test4"),
            )).style(|s| s.items_center().justify_center()),
        )).style(|s| s.padding_left(40)),
    ))
    .style(|style| {
        style
            .width_full()
            .height_full()
            .justify_center()
            .items_center()
    })
}

The result is the button with only an X number of images depending on the format of the image in question, support for the formats selected is enabled in the crate.

Image

Ideally it would render all images, am I doing something wrong? Please let me know

OS: Windows 11; Rust edition: 2024; Floem version: 0.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions