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. --- doc/ScintillaHistory.html | 7 +++++++ win32/ScintillaWin.cxx | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index e78ef1070..196a7710d 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -564,6 +564,7 @@ Michael Neuroth Arne Scheffler + Derek

Releases

@@ -580,6 +581,12 @@
  • On GTK, fix potential crash when closing Scintilla instances due to releasing global settings object.
  • +
  • + On Win32, when window is wider than scroll width, + use correct values when checking whether to change horizontal scroll bar so + only update and notify dwell end when needed. + Bug #2288. +
  • Release 5.1.3 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