[lcar] flip for and switch position

This commit is contained in:
Ebrahim Byagowi 2019-07-27 14:56:18 +04:30 committed by Behdad Esfahbod
parent 4e1da6bb61
commit 388fa9b326
1 changed files with 10 additions and 6 deletions

View File

@ -55,17 +55,21 @@ struct lcar
if (caret_count)
{
hb_array_t<const HBINT16> 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;
}