[AAT] In InsertionChain, set mark to previous-position if inserting
Fixes MORX-31
diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index a301fd3..2ebbc35 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -729,6 +729,8 @@
hb_buffer_t *buffer = driver->buffer;
unsigned int flags = entry->flags;
+ unsigned mark_loc = buffer->out_len;
+
if (entry->data.markedInsertIndex != 0xFFFF)
{
unsigned int count = (flags & MarkedInsertCount);
@@ -754,6 +756,9 @@
buffer->unsafe_to_break_from_outbuffer (mark, MIN (buffer->idx + 1, buffer->len));
}
+ if (flags & SetMark)
+ mark = mark_loc;
+
if (entry->data.currentInsertIndex != 0xFFFF)
{
unsigned int count = (flags & CurrentInsertCount) >> 5;
@@ -791,9 +796,6 @@
buffer->move_to ((flags & DontAdvance) ? end : end + count);
}
- if (flags & SetMark)
- mark = buffer->out_len;
-
return true;
}