mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 07:10:04 -04:00
Optimize text layout
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
use std::{collections::BTreeMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use rusttype::{point, Scale};
|
use rusttype::{point, Scale};
|
||||||
@@ -179,7 +179,7 @@ pub struct Font {
|
|||||||
/// Maximum character height
|
/// Maximum character height
|
||||||
scale_in_pixels: f32,
|
scale_in_pixels: f32,
|
||||||
pixels_per_point: f32,
|
pixels_per_point: f32,
|
||||||
glyph_infos: BTreeMap<char, GlyphInfo>,
|
glyph_infos: HashMap<char, GlyphInfo>, // TODO: optimize these lookups, e.g. with binary search or a fast hashmap
|
||||||
atlas: Arc<Mutex<TextureAtlas>>,
|
atlas: Arc<Mutex<TextureAtlas>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user