get_glyph_atlas_info
refactor (#17044)
# Objective Return a `GlyphAtlasInfo` instead of a tuple from the inner block so we can remove the outer mapping.
This commit is contained in:
parent
c890cc9dc3
commit
d2f61e24e7
@ -179,22 +179,15 @@ impl FontAtlasSet {
|
|||||||
self.font_atlases
|
self.font_atlases
|
||||||
.get(&FontAtlasKey(cache_key.font_size_bits, font_smoothing))
|
.get(&FontAtlasKey(cache_key.font_size_bits, font_smoothing))
|
||||||
.and_then(|font_atlases| {
|
.and_then(|font_atlases| {
|
||||||
font_atlases
|
font_atlases.iter().find_map(|atlas| {
|
||||||
.iter()
|
atlas
|
||||||
.find_map(|atlas| {
|
.get_glyph_index(cache_key)
|
||||||
atlas.get_glyph_index(cache_key).map(|location| {
|
.map(|location| GlyphAtlasInfo {
|
||||||
(
|
location,
|
||||||
location,
|
texture_atlas: atlas.texture_atlas.clone_weak(),
|
||||||
atlas.texture_atlas.clone_weak(),
|
texture: atlas.texture.clone_weak(),
|
||||||
atlas.texture.clone_weak(),
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.map(|(location, texture_atlas, texture)| GlyphAtlasInfo {
|
|
||||||
texture_atlas,
|
|
||||||
location,
|
|
||||||
texture,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user