1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Don't add leading space to more than one split layout section

This commit is contained in:
Hubert Głuchowski
2024-11-29 11:55:15 +01:00
parent 4e3f162801
commit 3de1723659

View File

@@ -793,7 +793,14 @@ impl GalleyCache {
assert!(s.byte_range.contains(&current));
let section_end = s.byte_range.end.min(end);
line_job.sections.push(crate::text::LayoutSection {
leading_space: s.leading_space,
// Leading space should only be added to the first section
// if the there are multiple sections that will be created
// from splitting the current section.
leading_space: if current == s.byte_range.start {
s.leading_space
} else {
0.0
},
byte_range: current - start..section_end - start,
format: s.format.clone(),
});