emilk / emilk/egui

Horizontal wrapped layout placed in a gird cell is incorrectly drawn

Open
#7,688 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

When a [horizontal_wrapped](https://docs.rs/egui/latest/egui/struct.Ui.html#method.horizontal_wrapped) is placed in a grid, and wrapping occurs, it seems that height is correctly calculated but the whole UI centered as if wasn't resized.

This is screenshot from my app - the tags here are slightly modified egui::Label with some extra padding. As one can observe, the height of the row is rather fine (bigger), but the horizontal wrapped layout is centered as it height before wrapping occurs.
Image

Here's the minimum reproducer, based on `egui/examples/hello_world/src`: https://gist.github.com/WojciechMula/f926719d9c04e61da0214cacf18f16d8

Contributor guide

Open the contributing guide

Research direction

Start with egui::Ui::horizontal_wrapped and the grid behavior described in the minimum reproducer based on egui/examples/hello_world/src; compare the layout bounds before and after wrapping. Use the linked gist and screenshot to reproduce the centered content. Done means wrapped content is positioned using its resized height while preserving the correct grid row height.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.