mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Don't add leading space to more than one split layout section
This commit is contained in:
@@ -793,7 +793,14 @@ impl GalleyCache {
|
|||||||
assert!(s.byte_range.contains(¤t));
|
assert!(s.byte_range.contains(¤t));
|
||||||
let section_end = s.byte_range.end.min(end);
|
let section_end = s.byte_range.end.min(end);
|
||||||
line_job.sections.push(crate::text::LayoutSection {
|
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,
|
byte_range: current - start..section_end - start,
|
||||||
format: s.format.clone(),
|
format: s.format.clone(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user