diff options
author | Neil <nyamatongwe@gmail.com> | 2025-03-29 18:14:57 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-03-29 18:14:57 +1100 |
commit | ba688f069206dc113d16b97a03dc3ff78497597d (patch) | |
tree | 0398bbe861d6bf8d84c93ad96db0106d120c1656 /win32/SurfaceD2D.cxx | |
parent | 9ccbd1eb1fb1c53fc7be721f98b0acb207e56723 (diff) | |
download | scintilla-mirror-ba688f069206dc113d16b97a03dc3ff78497597d.tar.gz |
Use constant definitions to avoid warnings.
Diffstat (limited to 'win32/SurfaceD2D.cxx')
-rw-r--r-- | win32/SurfaceD2D.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/win32/SurfaceD2D.cxx b/win32/SurfaceD2D.cxx index 39b02fa7e..b49e5d6f6 100644 --- a/win32/SurfaceD2D.cxx +++ b/win32/SurfaceD2D.cxx @@ -165,7 +165,8 @@ struct FontDirectWrite : public FontWin { ComPtr<IDWriteTextFormat> pTextFormat; FontQuality extraFontFlag = FontQuality::QualityDefault; CharacterSet characterSet = CharacterSet::Ansi; - FLOAT yAscent = 2.0f; + static constexpr FLOAT minimalAscent = 2.0f; + FLOAT yAscent = minimalAscent; FLOAT yDescent = 1.0f; FLOAT yInternalLeading = 0.0f; @@ -530,6 +531,8 @@ int SurfaceD2D::DeviceHeightFont(int points) { return ::MulDiv(points, LogPixelsY(), pointsPerInch); } +constexpr FLOAT mitreLimit = 4.0f; + void SurfaceD2D::LineDraw(Point start, Point end, Stroke stroke) { D2DPenColourAlpha(stroke.colour); @@ -538,7 +541,7 @@ void SurfaceD2D::LineDraw(Point start, Point end, Stroke stroke) { strokeProps.endCap = D2D1_CAP_STYLE_SQUARE; strokeProps.dashCap = D2D1_CAP_STYLE_FLAT; strokeProps.lineJoin = D2D1_LINE_JOIN_MITER; - strokeProps.miterLimit = 4.0f; + strokeProps.miterLimit = mitreLimit; strokeProps.dashStyle = D2D1_DASH_STYLE_SOLID; strokeProps.dashOffset = 0; @@ -584,7 +587,7 @@ void SurfaceD2D::PolyLine(const Point *pts, size_t npts, Stroke stroke) { strokeProps.endCap = D2D1_CAP_STYLE_ROUND; strokeProps.dashCap = D2D1_CAP_STYLE_FLAT; strokeProps.lineJoin = D2D1_LINE_JOIN_MITER; - strokeProps.miterLimit = 4.0f; + strokeProps.miterLimit = mitreLimit; strokeProps.dashStyle = D2D1_DASH_STYLE_SOLID; strokeProps.dashOffset = 0; |