aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2026-04-22 11:49:27 +1000
committerNeil <nyamatongwe@gmail.com>2026-04-22 11:49:27 +1000
commit1edd62a5285aa4ab1e8a40aff045a17913c41127 (patch)
tree392c84c1df1a4c68caffa5a9a9ab8cf2e3417165
parent5895f2ff84ccb6610342370d4b9ff3940e5f399a (diff)
downloadscintilla-mirror-1edd62a5285aa4ab1e8a40aff045a17913c41127.tar.gz
Use std::max to clarify code and avoid warning.
-rw-r--r--win32/ScintillaWin.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 69a6d307b..609740758 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -333,9 +333,9 @@ public:
void SetCompositionFont(const ViewStyle &vs, int style, UINT dpi) const {
LOGFONTW lf{};
- int sizeZoomed = vs.styles[style].size + (vs.zoomLevel * FontSizeMultiplier);
- if (sizeZoomed <= 2 * FontSizeMultiplier) // Hangs if sizeZoomed <= 1
- sizeZoomed = 2 * FontSizeMultiplier;
+ // Hangs if font height <= 1, so force minimum value
+ const int sizeZoomed = std::max(vs.styles[style].size + (vs.zoomLevel * FontSizeMultiplier),
+ 2 * FontSizeMultiplier);
// The negative is to allow for leading
lf.lfHeight = -::MulDiv(sizeZoomed, dpi, pointsPerInch * FontSizeMultiplier);
lf.lfWeight = static_cast<LONG>(vs.styles[style].weight);