Fix text node thread locals not being updated (#3173)
This commit is contained in:
parent
75ad8d4abd
commit
3cc2aa8d89
|
|
@ -176,11 +176,8 @@ fn render_glyph_run(glyph_run: &GlyphRun<'_, ()>, path_builder: &mut PathBuilder
|
||||||
}
|
}
|
||||||
|
|
||||||
fn layout_text(str: &str, font_data: Option<Blob<u8>>, typesetting: TypesettingConfig) -> Option<Layout<()>> {
|
fn layout_text(str: &str, font_data: Option<Blob<u8>>, typesetting: TypesettingConfig) -> Option<Layout<()>> {
|
||||||
let font_cx = FONT_CONTEXT.with(Clone::clone);
|
FONT_CONTEXT.with_borrow_mut(|mut font_cx| {
|
||||||
let mut font_cx = font_cx.borrow_mut();
|
LAYOUT_CONTEXT.with_borrow_mut(|layout_cx| {
|
||||||
let layout_cx = LAYOUT_CONTEXT.with(Clone::clone);
|
|
||||||
let mut layout_cx = layout_cx.borrow_mut();
|
|
||||||
|
|
||||||
let font_family = font_data.and_then(|font_data| {
|
let font_family = font_data.and_then(|font_data| {
|
||||||
font_cx
|
font_cx
|
||||||
.collection
|
.collection
|
||||||
|
|
@ -203,6 +200,8 @@ fn layout_text(str: &str, font_data: Option<Blob<u8>>, typesetting: TypesettingC
|
||||||
layout.align(typesetting.max_width.map(|max_w| max_w as f32), typesetting.align.into(), AlignmentOptions::default());
|
layout.align(typesetting.max_width.map(|max_w| max_w as f32), typesetting.align.into(), AlignmentOptions::default());
|
||||||
|
|
||||||
Some(layout)
|
Some(layout)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_path(str: &str, font_data: Option<Blob<u8>>, typesetting: TypesettingConfig, per_glyph_instances: bool) -> Table<Vector> {
|
pub fn to_path(str: &str, font_data: Option<Blob<u8>>, typesetting: TypesettingConfig, per_glyph_instances: bool) -> Table<Vector> {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue