diff options
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r-- | generic/tkTextDisp.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 49a35f5..f718e2a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5546,32 +5546,35 @@ TkTextSeeCmd( /* * Call a chunk-specific function to find the horizontal range of the - * character within the chunk. + * character within the chunk. chunkPtr is NULL if trying to see in elided + * region. */ - (*chunkPtr->bboxProc)(textPtr, chunkPtr, byteCount, - dlPtr->y + dlPtr->spaceAbove, - dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow, - dlPtr->baseline - dlPtr->spaceAbove, &x, &y, &width, - &height); - delta = x - dInfoPtr->curXPixelOffset; - oneThird = lineWidth/3; - if (delta < 0) { - if (delta < -oneThird) { - dInfoPtr->newXPixelOffset = (x - lineWidth/2); - } else { - dInfoPtr->newXPixelOffset -= ((-delta) ); - } - } else { - delta -= (lineWidth - width); - if (delta > 0) { - if (delta > oneThird) { + if (chunkPtr != NULL) { + (*chunkPtr->bboxProc)(textPtr, chunkPtr, byteCount, + dlPtr->y + dlPtr->spaceAbove, + dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow, + dlPtr->baseline - dlPtr->spaceAbove, &x, &y, &width, + &height); + delta = x - dInfoPtr->curXPixelOffset; + oneThird = lineWidth/3; + if (delta < 0) { + if (delta < -oneThird) { dInfoPtr->newXPixelOffset = (x - lineWidth/2); } else { - dInfoPtr->newXPixelOffset += (delta ); + dInfoPtr->newXPixelOffset -= ((-delta) ); } } else { - return TCL_OK; + delta -= (lineWidth - width); + if (delta > 0) { + if (delta > oneThird) { + dInfoPtr->newXPixelOffset = (x - lineWidth/2); + } else { + dInfoPtr->newXPixelOffset += (delta ); + } + } else { + return TCL_OK; + } } } dInfoPtr->flags |= DINFO_OUT_OF_DATE; |