From 806ad8dc65931ab7893bff7d5592a67a9bd237ca Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Feb 2016 14:53:11 +0700 Subject: [PATCH] [GPOS] Minor shuffling --- src/hb-ot-layout-gpos-table.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 25b9d64f7..8c83cf28c 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1522,10 +1522,11 @@ reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direc if (likely (!j)) return; - j += i; - + int old_chain = j; pos[i].cursive_chain() = 0; + j += i; + /* Stop if we see new parent in the chain. */ if (j == new_parent) return; @@ -1537,7 +1538,7 @@ reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direc else pos[j].x_offset = -pos[i].x_offset; - pos[j].cursive_chain() = i - j; + pos[j].cursive_chain() = -old_chain; } static void fix_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction) @@ -1545,11 +1546,10 @@ fix_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction unsigned int j = pos[i].cursive_chain(); if (likely (!j)) return; + pos[i].cursive_chain() = 0; j += i; - pos[i].cursive_chain() = 0; - fix_cursive_minor_offset (pos, j, direction); if (HB_DIRECTION_IS_HORIZONTAL (direction))