BoxDiagrams.TextBox.HitTest C# (CSharp) Метод

HitTest() публичный Метод

public HitTest ( Loyc.Geometry.Point pos, Loyc.Geometry.Vector hitTestRadius, SelType sel ) : Util.WinForms.HitTestResult
pos Loyc.Geometry.Point
hitTestRadius Loyc.Geometry.Vector
sel SelType
Результат Util.WinForms.HitTestResult
		public override Util.WinForms.HitTestResult HitTest(PointT pos, VectorT hitTestRadius, SelType sel)
		{
			if (sel != SelType.No) {
				var bbox2 = BBox.Inflated(hitTestRadius.X, hitTestRadius.Y);
				PointT tl = BBox.MinPoint, tr = new PointT(Right, Top);
				PointT br = BBox.MaxPoint, bl = new PointT(Left, Bottom);
				if (PointsAreNear(pos, tr, hitTestRadius))
					return new HitTestResult(this, Cursors.SizeNESW, RF.Top | RF.Right);
				if (PointsAreNear(pos, bl, hitTestRadius))
					return new HitTestResult(this, Cursors.SizeNESW, RF.Bottom | RF.Left);
				if (sel == SelType.Yes) {
					if (PointsAreNear(pos, tl, hitTestRadius))
						return new HitTestResult(this, Cursors.SizeNWSE, RF.Top | RF.Left);
					if (PointsAreNear(pos, br, hitTestRadius))
						return new HitTestResult(this, Cursors.SizeNWSE, RF.Bottom | RF.Right);
				}
			}
			if (sel != SelType.No || (BoxType != BoxType.Borderless && !_isPanel))
			{
				if (sel != SelType.Yes)
					hitTestRadius *= 2;
				var bbox2 = BBox.Deflated(hitTestRadius.X, hitTestRadius.Y);
				if (bbox2.Contains(pos))
					return new HitTestResult(this, Cursors.SizeAll, RF.Top | RF.Bottom | RF.Left | RF.Right);
			}

			return BBox.Contains(pos) ? new HitTestResult(this, Cursors.Arrow, 0) : null;
		}