summaryrefslogtreecommitdiffstats
path: root/generic/tkTextBTree.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r--generic/tkTextBTree.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index 7832992..1b65cbc 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -1727,6 +1727,26 @@ TkBTreeFindPixelLine(
}
pixels -= linePtr->pixels[2 * pixelReference];
}
+
+ /*
+ * Check for any start/end offset for this text widget.
+ */
+
+ if (textPtr->start != NULL) {
+ int lineBoundary = TkBTreeLinesTo(NULL, textPtr->start);
+
+ if (TkBTreeLinesTo(NULL, linePtr) < lineBoundary) {
+ linePtr = TkBTreeFindLine(tree, NULL, lineBoundary);
+ }
+ }
+ if (textPtr->end != NULL) {
+ int lineBoundary = TkBTreeLinesTo(NULL, textPtr->end);
+
+ if (TkBTreeLinesTo(NULL, linePtr) > lineBoundary) {
+ linePtr = TkBTreeFindLine(tree, NULL, lineBoundary);
+ }
+ }
+
if (pixelOffset != NULL && linePtr != NULL) {
*pixelOffset = pixels;
}