diff options
author | Neil <nyamatongwe@gmail.com> | 2016-12-09 09:05:21 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2016-12-09 09:05:21 +1100 |
commit | 82ee0a0a14f83b3d85e7298f82165667c77b9a34 (patch) | |
tree | 5fb285e157cdbd5d761b8dedf67c77c83f302b4c /src/PositionCache.h | |
parent | 6a529a0ea1126b231577507ed03389f32b962f67 (diff) | |
download | scintilla-mirror-82ee0a0a14f83b3d85e7298f82165667c77b9a34.tar.gz |
Use double coordinates instead of float in some cases as float ran out of
precision in long documents. This meant that individual lines could not be
selected by mouse when the document exceeded 16.7 million lines.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index 5a829b76b..c0d2b7f3e 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -16,6 +16,23 @@ static inline bool IsEOLChar(char ch) { return (ch == '\r') || (ch == '\n'); } +/** +* A point in document space. +* Uses double for sufficient resolution in large (>20,000,000 line) documents. +*/ +class PointDocument { +public: + double x; + double y; + + explicit PointDocument(double x_ = 0, double y_ = 0) : x(x_), y(y_) { + } + + // Conversion from Point. + explicit PointDocument(Point pt) : x(pt.x), y(pt.y) { + } +}; + // There are two points for some positions and this enumeration // can choose between the end of the first line or subline // and the start of the next line or subline. |