From f5811bad04be9dac8a4fca8e16904d6270e47777 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi <ebrahim@gnu.org> Date: Tue, 17 Apr 2018 09:13:03 +0430 Subject: [PATCH] Add round to F2DOT14 inner store setter (#990) It uses floor implicitly without it but explicit use of round will be more correct. --- src/hb-open-type-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 623d0b2e1..1f2421b07 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -685,7 +685,7 @@ struct F2DOT14 : HBINT16 { // 16384 means 1<<14 inline float to_float (void) const { return ((int32_t) v) / 16384.0; } - inline void set_float (float f) { v.set (f * 16384.0); } + inline void set_float (float f) { v.set (round (f * 16384.0)); } public: DEFINE_SIZE_STATIC (2); };