Browse Source

The barSize should use the Scroll Viewport.

BDisp 1 year ago
parent
commit
70b3be289b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Terminal.Gui/Views/Scroll/ScrollSlider.cs

+ 1 - 1
Terminal.Gui/Views/Scroll/ScrollSlider.cs

@@ -71,7 +71,7 @@ internal class ScrollSlider : View
     {
         int location = SuperViewAsScroll.Orientation == Orientation.Vertical ? mouseEvent.Position.Y : mouseEvent.Position.X;
         int offset = _lastLocation > -1 ? location - _lastLocation : 0;
-        int barSize = SuperViewAsScroll.Orientation == Orientation.Vertical ? SuperViewAsScroll.GetContentSize ().Height : SuperViewAsScroll.GetContentSize ().Width;
+        int barSize = SuperViewAsScroll.Orientation == Orientation.Vertical ? SuperViewAsScroll.Viewport.Height : SuperViewAsScroll.Viewport.Width;
 
         if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Pressed) && _lastLocation == -1)
         {