mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibWeb/CSS: Don't overwrite active font load when requesting a pt size
start_loading_next_url() is a no-op if there's a pending resource load, but not if that resource load has successfully loaded already. There is a delay between the font resource loading, and it being processed into a vector font. Calling font_with_point_size() in that gap would previously erase the previously-loaded font, if the font had multiple URLs to choose from. This fixes the icon font on mods.factorio.com :^)
This commit is contained in:
parent
b3edbd7bf2
commit
28388f1fd2
Notes:
github-actions[bot]
2024-12-20 17:20:38 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/28388f1fd24 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2993 Reviewed-by: https://github.com/gmta ✅
1 changed files with 2 additions and 1 deletions
|
@ -228,7 +228,8 @@ void FontLoader::resource_did_load_or_fail()
|
|||
RefPtr<Gfx::Font> FontLoader::font_with_point_size(float point_size)
|
||||
{
|
||||
if (!m_vector_font) {
|
||||
start_loading_next_url();
|
||||
if (!resource())
|
||||
start_loading_next_url();
|
||||
return nullptr;
|
||||
}
|
||||
return m_vector_font->scaled_font(point_size);
|
||||
|
|
Loading…
Add table
Reference in a new issue