mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
Don't add merged Galley to galley cache
This commit is contained in:
@@ -783,15 +783,10 @@ impl GalleyCache {
|
|||||||
let job = Arc::new(job);
|
let job = Arc::new(job);
|
||||||
if allow_split_paragraphs && should_cache_each_paragraph_individually(&job) {
|
if allow_split_paragraphs && should_cache_each_paragraph_individually(&job) {
|
||||||
let galley = self.layout_each_paragraph_individuallly(fonts, job);
|
let galley = self.layout_each_paragraph_individuallly(fonts, job);
|
||||||
let galley = Arc::new(galley);
|
// TODO(afishhh): This Galley cannot be added directly into the cache without taking
|
||||||
self.cache.insert(
|
// extra precautions to make sure all component paragraph Galleys are not invalidated
|
||||||
hash,
|
// immediately next frame (since their `last_used` will not be updated).
|
||||||
CachedGalley {
|
Arc::new(galley)
|
||||||
last_used: self.generation,
|
|
||||||
galley: galley.clone(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
galley
|
|
||||||
} else {
|
} else {
|
||||||
let galley = super::layout(fonts, job);
|
let galley = super::layout(fonts, job);
|
||||||
let galley = Arc::new(galley);
|
let galley = Arc::new(galley);
|
||||||
@@ -850,8 +845,6 @@ impl GalleyCache {
|
|||||||
format,
|
format,
|
||||||
} = section;
|
} = section;
|
||||||
|
|
||||||
// dbg!(section_index, section_range);
|
|
||||||
|
|
||||||
// `start` and `end` are the byte range of the current paragraph.
|
// `start` and `end` are the byte range of the current paragraph.
|
||||||
// How does the current section overlap with the paragraph range?
|
// How does the current section overlap with the paragraph range?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user