Use IsDragging that way people can drag scroll bar

This commit is contained in:
Jaex 2018-04-04 19:00:38 +03:00
parent 548505f833
commit 98f26fa25a

View file

@ -57,6 +57,11 @@ public void Update()
if (Visible) if (Visible)
{ {
if (IsDragging)
{
Scroll(form.ShapeManager.InputManager.ClientMousePosition);
}
Rectangle imageRectangleVisible = form.CanvasRectangle; Rectangle imageRectangleVisible = form.CanvasRectangle;
imageRectangleVisible.Intersect(form.ClientArea); imageRectangleVisible.Intersect(form.ClientArea);
@ -157,10 +162,8 @@ public override void OnDraw(Graphics g)
} }
} }
public override void OnMouseDown(Point position) public void Scroll(Point position)
{ {
base.OnMouseDown(position);
int inMousePosition, inClientAreaSize, inImageSize; int inMousePosition, inClientAreaSize, inImageSize;
if (Orientation == Orientation.Horizontal) if (Orientation == Orientation.Horizontal)