From 1edd62a5285aa4ab1e8a40aff045a17913c41127 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 22 Apr 2026 11:49:27 +1000 Subject: Use std::max to clarify code and avoid warning. --- win32/ScintillaWin.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'win32') 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(vs.styles[style].weight); -- cgit v1.2.3