Make sure to increment the line counter only if the offset of the new
line is actually legal and inside the bounds of the text size. Fixes
random crashes in case the last symbol of the line is a break.
git-blame says it's Evgeniys fault, it wasn't caused by the recent
layout changes.
sizeof(LineInfo) *
text_info->max_lines);
}
- if (lead < text_info->length)
+ if (lead < text_info->length) {
text_info->glyphs[lead].linebreak = break_type;
- last_space = -1;
- s1 = text_info->glyphs + lead;
- s_offset = d6_to_double(s1->bbox.xMin + s1->pos.x);
- text_info->n_lines++;
+ last_space = -1;
+ s1 = text_info->glyphs + lead;
+ s_offset = d6_to_double(s1->bbox.xMin + s1->pos.x);
+ text_info->n_lines++;
+ }
}
}
#define DIFF(x,y) (((x) < (y)) ? (y - x) : (x - y))