egui icon indicating copy to clipboard operation
egui copied to clipboard

Fix textedit intrinsic size metric

Open lucasmerlin opened this issue 1 year ago • 1 comments

Since textedit is doing the justify layout calculation itself, we need to report the original desired_size as intrinsic size, instead of the value passed to allocate_space.

I wonder though, is it still necessary that the TextEdit does the justify calculation itself instead of relying on the ui layout to do it? As far as I understand it, justify should be handled by the ui.allocate_space call.

lucasmerlin avatar Oct 16 '24 14:10 lucasmerlin

Preview available at https://egui-pr-preview.github.io/pr/5275-fix-textedit-intrinsic-size Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

github-actions[bot] avatar Oct 16 '24 14:10 github-actions[bot]

I wonder though, is it still necessary that the TextEdit does the justify calculation itself instead of relying on the ui layout to do it? As far as I understand it, justify should be handled by the ui.allocate_space call.

I think ui.allocate_space should be able to handle it, unless I'm missing something. Could just be legacy.

emilk avatar Oct 28 '24 12:10 emilk