From 7dee2d70332865546cc8e80b585559fd38864c4e Mon Sep 17 00:00:00 2001 From: BDisp Date: Sat, 13 Jun 2020 13:25:30 +0100 Subject: [PATCH] Faster ScrollView. Try it with CharacterMap. --- Terminal.Gui/Views/ScrollView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Views/ScrollView.cs b/Terminal.Gui/Views/ScrollView.cs index 0f2e01c00..7bfdbd5fb 100644 --- a/Terminal.Gui/Views/ScrollView.cs +++ b/Terminal.Gui/Views/ScrollView.cs @@ -271,9 +271,9 @@ namespace Terminal.Gui { return true; } else if (location <= barsize) { if (location > 1 && location >= b2) - SetPosition (Math.Min (pos + barsize, Size)); + SetPosition (Math.Min (pos + (Size / location), Size - 1)); else if (location <= b2 && pos > 0 || pos > 0) - SetPosition (Math.Max (pos - barsize, 0)); + SetPosition (Math.Max (pos - (Size / barsize), 0)); } }