SecondHalfGames/yakui

Constrained box at root takes the whole space

Uriopass opened this issue · 1 comments

Not sure if a bug or not, but could be useful to anyone having the same issue. Rendering a colored box at the root takes the whole space even if constrained.

See this example:

        yakui::colored_box_container(colors::BACKGROUND_2, || {
            yakui::pad(Pad::all(8.0), || {
                yakui::text(10.0, "hi");
            });
        });

image

And as a workaround, the layout works as expected with yakui::column

        yakui::column(|| {
            yakui::colored_box_container(colors::BACKGROUND_2, || {
                yakui::pad(Pad::all(8.0), || {
                    yakui::text(10.0, "hi");
                });
            });
        });

image

Actually I think that's the default flutter behavior: the root is forced to screen size. See the doc example #2.