From f252cf80e194130d26ae3057227dc86dc60f8cb8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 16 Dec 2022 12:03:51 -0700 Subject: [PATCH] [open-type] Allow passing an offset to to_float() --- src/hb-open-type.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 16bf005c8..0c479cfc0 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -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 () const { return ((int32_t) Type::v) / shift; } + float to_float (int32_t 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);