getLineBoundary edge condition use <= instead of < (#13881)

This commit is contained in:
Gary Qian 2019-11-15 15:14:03 -08:00 committed by GitHub
parent 38a440cc0f
commit b3463e3580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,7 +140,7 @@ Dart_Handle Paragraph::getLineBoundary(unsigned offset) {
int line_start = -1;
int line_end = -1;
for (txt::LineMetrics& line : metrics) {
if (offset >= line.start_index && offset < line.end_index) {
if (offset >= line.start_index && offset <= line.end_index) {
line_start = line.start_index;
line_end = line.end_index;
break;