提交 388fa9b3 编写于 作者: E Ebrahim Byagowi 提交者: Behdad Esfahbod

[lcar] flip for and switch position

上级 4e1da6bb
...@@ -55,17 +55,21 @@ struct lcar ...@@ -55,17 +55,21 @@ struct lcar
if (caret_count) if (caret_count)
{ {
hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count); hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count);
unsigned int count = arr.length; switch (format)
for (unsigned int i = 0; i < count; ++i) {
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; hb_position_t x, y;
font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &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; caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
break;
} }
break;
}
} }
return array.len; return array.len;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册