diff options
Diffstat (limited to 'scintilla/src/PositionCache.cxx')
-rw-r--r-- | scintilla/src/PositionCache.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scintilla/src/PositionCache.cxx b/scintilla/src/PositionCache.cxx index c9cf637..66b634a 100644 --- a/scintilla/src/PositionCache.cxx +++ b/scintilla/src/PositionCache.cxx @@ -217,7 +217,7 @@ int LineLayout::FindPositionFromX(XYPOSITION x, Range range, bool charPosition) return range.end;
}
-Point LineLayout::PointFromPosition(int posInLine, int lineHeight) const {
+Point LineLayout::PointFromPosition(int posInLine, int lineHeight, PointEnd pe) const {
Point pt;
// In case of very long line put x at arbitrary large position
if (posInLine > maxLineLength) {
@@ -232,6 +232,12 @@ Point LineLayout::PointFromPosition(int posInLine, int lineHeight) const { pt.x = positions[posInLine] - positions[rangeSubLine.start];
if (rangeSubLine.start != 0) // Wrapped lines may be indented
pt.x += wrapIndent;
+ if (pe & peSubLineEnd) // Return end of first subline not start of next
+ break;
+ } else if ((pe & peLineEnd) && (subLine == (lines-1))) {
+ pt.x = positions[numCharsInLine] - positions[rangeSubLine.start];
+ if (rangeSubLine.start != 0) // Wrapped lines may be indented
+ pt.x += wrapIndent;
}
} else {
break;
|