From 388fa9b32611a8726b9bbfe7ccf8cdbcd818fd70 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 27 Jul 2019 14:56:18 +0430 Subject: [PATCH] [lcar] flip for and switch position --- src/hb-aat-layout-lcar-table.hh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/hb-aat-layout-lcar-table.hh b/src/hb-aat-layout-lcar-table.hh index cd96d034d..2e45fd28b 100644 --- a/src/hb-aat-layout-lcar-table.hh +++ b/src/hb-aat-layout-lcar-table.hh @@ -55,17 +55,21 @@ struct lcar if (caret_count) { hb_array_t arr = array.sub_array (start_offset, caret_count); - unsigned int count = arr.length; - for (unsigned int i = 0; i < count; ++i) - switch (format) + switch (format) + { + case 0: + for (unsigned int i = 0; i < arr.length; ++i) + caret_array[i] = font->em_scale_dir (arr[i], direction); + break; + case 1: + for (unsigned int i = 0; i < arr.length; ++i) { - case 0: caret_array[i] = font->em_scale_dir (arr[i], direction); break; - case 1: hb_position_t x, y; font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y); caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y; - break; } + break; + } } return array.len; }