aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-26 16:36:29 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-26 16:36:29 +1100
commit7a3c73483c17da8f669fe3551ad274a02144486a (patch)
tree07402a7e1d2a83c0a1c44f843aba41615623c2c1 /src
parentf96ffc423d8af568c0f1dc066a4adbec54d49bdb (diff)
downloadscintilla-mirror-7a3c73483c17da8f669fe3551ad274a02144486a.tar.gz
Bug [#2224]. Switch XYPOSITION to double so it has more precision to fix
problems with very long documents. Fixes uneven line heights on Cocoa after around 1.1 million lines.
Diffstat (limited to 'src')
-rw-r--r--src/Geometry.h9
-rw-r--r--src/LineMarker.cxx2
-rw-r--r--src/Platform.h4
3 files changed, 9 insertions, 6 deletions
diff --git a/src/Geometry.h b/src/Geometry.h
index c3c539e6d..ed158c081 100644
--- a/src/Geometry.h
+++ b/src/Geometry.h
@@ -10,7 +10,7 @@
namespace Scintilla {
-typedef float XYPOSITION;
+typedef double XYPOSITION;
typedef double XYACCUMULATOR;
// Test if an enum class value has the bit flag(s) of test set.
@@ -257,6 +257,9 @@ public:
constexpr Stroke(ColourAlpha colour_, XYPOSITION width_=1.0f) noexcept :
colour(colour_), width(width_) {
}
+ constexpr float WidthF() {
+ return static_cast<float>(width);
+ }
};
/**
@@ -293,9 +296,9 @@ public:
*/
class ColourStop {
public:
- float position;
+ XYPOSITION position;
ColourAlpha colour;
- constexpr ColourStop(float position_, ColourAlpha colour_) noexcept :
+ constexpr ColourStop(XYPOSITION position_, ColourAlpha colour_) noexcept :
position(position_), colour(colour_) {
}
};
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index 13d8b05ae..5acfb7cb3 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -147,7 +147,7 @@ void DrawTail(Surface *surface, XYPOSITION leftLine, XYPOSITION rightTail, XYPOS
void LineMarker::DrawFoldingMark(Surface *surface, const PRectangle &rcWhole, FoldPart part) const {
// Assume: edges of rcWhole are integers.
// Code can only really handle integer strokeWidth.
- constexpr float strokeWidth = 1.0f;
+ constexpr XYPOSITION strokeWidth = 1.0f;
ColourDesired colourHead = back;
ColourDesired colourBody = back;
diff --git a/src/Platform.h b/src/Platform.h
index 8898e66f9..98e6440aa 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -96,7 +96,7 @@ constexpr const char *localeNameDefault = "en-us";
struct FontParameters {
const char *faceName;
- float size;
+ XYPOSITION size;
int weight;
bool italic;
int extraFontFlag;
@@ -106,7 +106,7 @@ struct FontParameters {
constexpr FontParameters(
const char *faceName_,
- float size_=10,
+ XYPOSITION size_=10,
int weight_=400,
bool italic_=false,
int extraFontFlag_=0,