for (int i = 0; i < lastPosition; i++)
{
final InlineSequenceElement element = sequenceElements[i];
if (element instanceof EndSequenceElement)
{
contexts.pop();
final long boxX2 = (elementPositions[i] + elementDimensions[i]);
//noinspection ConstantConditions
box.setWidth(boxX2 - box.getX());
if (contexts.isEmpty())