mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
LibGfx: Fix double x_scale multiply when glyph kerning is cached
This resolves a problem where the kerning value multiplied by the scale is stored in the cache, even though the code retrieving the value from the cache does not anticipate it to be scaled. As a result, it leads to a buggy double multiplication by the scale.
This commit is contained in:
parent
2ecafddd1c
commit
0bdc93bca8
1 changed files with 2 additions and 2 deletions
|
@ -701,9 +701,9 @@ float Font::glyphs_horizontal_kerning(u32 left_glyph_id, u32 right_glyph_id, flo
|
|||
}
|
||||
|
||||
if (m_kern.has_value()) {
|
||||
auto kerning = m_kern->get_glyph_kerning(left_glyph_id, right_glyph_id) * x_scale;
|
||||
auto kerning = m_kern->get_glyph_kerning(left_glyph_id, right_glyph_id);
|
||||
m_kerning_cache.set(cache_key, kerning);
|
||||
return kerning;
|
||||
return kerning * x_scale;
|
||||
}
|
||||
|
||||
m_kerning_cache.set(cache_key, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue