diff options
| author | nyamatongwe <devnull@localhost> | 2011-05-13 10:27:30 +1000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2011-05-13 10:27:30 +1000 | 
| commit | 15bfd9c723b0753dcf2b6e85f6b9be351af00378 (patch) | |
| tree | 14707aa7cea073ecb62849d09697a02ca38e9375 /src/PositionCache.h | |
| parent | 3166c901c7d071f2083a1a29ca710171fd7cf699 (diff) | |
| download | scintilla-mirror-15bfd9c723b0753dcf2b6e85f6b9be351af00378.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) { | 
