We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25da822 commit f406701Copy full SHA for f406701
crates/epaint/src/text/fonts.rs
@@ -762,7 +762,11 @@ impl GalleyCache {
762
cached.galley.clone()
763
}
764
std::collections::hash_map::Entry::Vacant(entry) => {
765
- if job.break_on_newline {
+ // If the text contains newlines that will always break into a new row then
766
+ // we can easily lay out all the lines separately and then merge the `Galley`s.
767
+ // This allows individual lines to be cached separately which means small
768
+ // modifications to the source text will only cause impacted lines to be laid out again.
769
+ if job.break_on_newline && job.text.contains('\n') {
770
let galley = self.layout_multiline(fonts, job);
771
let galley = Arc::new(galley);
772
self.cache.insert(
0 commit comments