From f61c799e7333538b3001d56977dc71de97ffedf3 Mon Sep 17 00:00:00 2001 From: Derek Date: Sat, 16 Oct 2021 06:39:09 -0400 Subject: Bug [#2288] When window wider than scroll width, compute horizEndPreferred correctly so that SetScrollInfo is not called nor dwell end notified unnecessarily. --- win32/ScintillaWin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index a45c7a076..4fd86ec7c 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2340,10 +2340,10 @@ bool ScintillaWin::ModifyScrollBars(Sci::Line nMax, Sci::Line nPage) { } const PRectangle rcText = GetTextRectangle(); - int horizEndPreferred = scrollWidth; + int pageWidth = static_cast(rcText.Width()); + int horizEndPreferred = std::max(scrollWidth, pageWidth-1); if (horizEndPreferred < 0) horizEndPreferred = 0; - int pageWidth = static_cast(rcText.Width()); if (!horizontalScrollBarVisible || Wrapping()) pageWidth = horizEndPreferred + 1; sci.fMask = SIF_PAGE | SIF_RANGE; -- cgit v1.2.3