[open-type] In to_float() take offset as float

This commit is contained in:
Behdad Esfahbod 2022-12-16 12:28:30 -07:00
parent 9e3bfd9aa1
commit 51a17201a7
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ struct HBFixed : Type
static_assert (Type::static_size * 8 > fraction_bits, "");
HBFixed& operator = (typename Type::type i ) { Type::operator= (i); return *this; }
float to_float (int32_t offset = 0) const { return ((int32_t) Type::v + offset) / shift; }
float to_float (float offset = 0) const { return ((int32_t) Type::v + offset) / shift; }
void set_float (float f) { Type::v = roundf (f * shift); }
public:
DEFINE_SIZE_STATIC (Type::static_size);