Merge pull request #2986 from L1Q/master

Limit panning based on 25% of client area instead of 100px
This commit is contained in:
Jaex 2017-12-08 13:46:03 +03:00 committed by GitHub
commit 4d310a4074
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -364,11 +364,9 @@ private void Pan(int deltaX, int deltaY, bool usePanningStretch = true)
PanningStrech.Y -= deltaY;
}
int panLimit = 100;
Size panLimitSize = new Size(
Math.Min(panLimit, CanvasRectangle.Width),
Math.Min(panLimit, CanvasRectangle.Height));
Math.Min((int)Math.Round(ClientArea.Width * 0.25f), CanvasRectangle.Width),
Math.Min((int)Math.Round(ClientArea.Height * 0.25f), CanvasRectangle.Height));
Rectangle limitRectangle = new Rectangle(
ClientArea.X + panLimitSize.Width, ClientArea.Y + panLimitSize.Height,