mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +00:00
LibGfx: Do not use divisions when calculating font subpixel offsets
No functional or performance changes; they were probably already optimized away by the compiler.
This commit is contained in:
parent
5bac9df865
commit
4df3b5e1d2
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ GlyphRasterPosition GlyphRasterPosition::get_nearest_fit_for(FloatPoint position
|
|||
constexpr auto subpixel_divisions = GlyphSubpixelOffset::subpixel_divisions();
|
||||
auto fit = [](float pos, int& blit_pos, u8& subpixel_offset) {
|
||||
blit_pos = floorf(pos);
|
||||
subpixel_offset = round_to<u8>((pos - blit_pos) / (1.0f / subpixel_divisions));
|
||||
subpixel_offset = round_to<u8>((pos - blit_pos) * subpixel_divisions);
|
||||
if (subpixel_offset >= subpixel_divisions) {
|
||||
blit_pos += 1;
|
||||
subpixel_offset = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue