diff options
author | nyamatongwe <unknown> | 2011-05-13 10:27:30 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2011-05-13 10:27:30 +1000 |
commit | ef61afe500f7ba58b1fcefaa1ab0205ccb66b5c2 (patch) | |
tree | 1ec46b88ebe5ce2651a1bd1642a5e6cf77c53c02 /src/PositionCache.h | |
parent | 67e0bd9337d9592fbc1199e3ab6f063ea1e62b45 (diff) | |
download | scintilla-mirror-ef61afe500f7ba58b1fcefaa1ab0205ccb66b5c2.tar.gz |
Break measurement of text into reasonable sized segments similar
to drawing. Drawing will now always be broken up at a character
boundary even when there is a large number of alphabetic characters.
Fixes bug #3165743.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index a76da574c..8bd4f1b43 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -117,16 +117,10 @@ public: // Class to break a line of text into shorter runs at sensible places. class BreakFinder { - // If a whole run is longer than lengthStartSubdivision then subdivide - // into smaller runs at spaces or punctuation. - enum { lengthStartSubdivision = 300 }; - // Try to make each subdivided run lengthEachSubdivision or shorter. - enum { lengthEachSubdivision = 100 }; LineLayout *ll; int lineStart; int lineEnd; int posLineStart; - bool utf8; int nextBreak; int *selAndEdge; unsigned int saeSize; @@ -134,9 +128,16 @@ class BreakFinder { unsigned int saeCurrentPos; int saeNext; int subBreak; + Document *pdoc; void Insert(int val); public: - BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_, bool utf8_, int xStart, bool breakForSelection); + // If a whole run is longer than lengthStartSubdivision then subdivide + // into smaller runs at spaces or punctuation. + enum { lengthStartSubdivision = 300 }; + // Try to make each subdivided run lengthEachSubdivision or shorter. + enum { lengthEachSubdivision = 100 }; + BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_, + int xStart, bool breakForSelection, Document *pdoc_); ~BreakFinder(); int First() const; int Next(); @@ -154,7 +155,7 @@ public: void SetSize(size_t size_); int GetSize() const { return size; } void MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber, - const char *s, unsigned int len, int *positions); + const char *s, unsigned int len, int *positions, Document *pdoc); }; inline bool IsSpaceOrTab(int ch) { |