Better round positions during scaling
Fixes https://github.com/harfbuzz/harfbuzz/issues/3274
This commit is contained in:
parent
52ccdc78e6
commit
bbaccf23d9
|
@ -620,9 +620,7 @@ struct hb_font_t
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_position_t em_mult (int16_t v, int64_t mult)
|
hb_position_t em_mult (int16_t v, int64_t mult)
|
||||||
{
|
{ return (hb_position_t) ((v * mult + 32768) >> 16); }
|
||||||
return (hb_position_t) ((v * mult) >> 16);
|
|
||||||
}
|
|
||||||
hb_position_t em_scalef (float v, int scale)
|
hb_position_t em_scalef (float v, int scale)
|
||||||
{ return (hb_position_t) roundf (v * scale / face->get_upem ()); }
|
{ return (hb_position_t) roundf (v * scale / face->get_upem ()); }
|
||||||
float em_fscale (int16_t v, int scale)
|
float em_fscale (int16_t v, int scale)
|
||||||
|
|
Loading…
Reference in New Issue