Browse Source

Merge pull request #681 from BDisp/faster-scroll-view

Faster ScrollView. Try it with CharacterMap.
Charlie Kindel 5 years ago
parent
commit
04cbe23cb0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Terminal.Gui/Views/ScrollView.cs

+ 2 - 2
Terminal.Gui/Views/ScrollView.cs

@@ -271,9 +271,9 @@ namespace Terminal.Gui {
 					return true;
 					return true;
 				} else if (location <= barsize) {
 				} else if (location <= barsize) {
 					if (location > 1 && location >= b2)
 					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)
 					else if (location <= b2 && pos > 0 || pos > 0)
-						SetPosition (Math.Max (pos - barsize, 0));
+						SetPosition (Math.Max (pos - (Size / barsize), 0));
 				}
 				}
 			}
 			}