diff --git a/blendish.h b/blendish.h index 30bc3cb..c9a97d4 100644 --- a/blendish.h +++ b/blendish.h @@ -2240,7 +2240,7 @@ static void bndCaretPosition(NVGcontext *ctx, float x, float y, int *cr, float *cx, float *cy) { static NVGglyphPosition glyphs[BND_MAX_GLYPHS]; int r,nglyphs; - for (r=0; r < nrows && rows[r].end < caret; ++r); + for (r=0; r < nrows-1 && rows[r].end < caret; ++r); *cr = r; *cx = x; *cy = y-lineHeight-desc + r*lineHeight;