本文整理汇总了C#中RectangleD.Offset方法的典型用法代码示例。如果您正苦于以下问题:C# RectangleD.Offset方法的具体用法?C# RectangleD.Offset怎么用?C# RectangleD.Offset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RectangleD
的用法示例。
在下文中一共展示了RectangleD.Offset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestHitAnchor
/// <summary>
/// Pulled directly from Reflector disassembly
/// </summary>
private static AnchorPoint TestHitAnchor(BinaryLinkShape linkShape, LineSegment segment, SizeD tolerance, PointD hitPoint)
{
RectangleD ed1 = new RectangleD(0, 0, tolerance.Width * 2, tolerance.Height * 2);
NodeShape shape1 = null;
bool flag1 = false;
if (linkShape != null)
{
PointD td1;
if (segment.IsStartSegment && segment.IsEndSegment)
{
if (ClosestEnd(segment, hitPoint))
{
td1 = segment.StartPoint;
shape1 = linkShape.FromShape;
flag1 = true;
}
else
{
td1 = segment.EndPoint;
shape1 = linkShape.ToShape;
}
}
else if (segment.IsStartSegment)
{
td1 = segment.StartPoint;
shape1 = linkShape.FromShape;
flag1 = true;
}
else if (segment.IsEndSegment)
{
td1 = segment.EndPoint;
shape1 = linkShape.ToShape;
}
else
{
return null;
}
if ((shape1 != null) && !shape1.IsPort)
{
ed1.Offset(td1.X - tolerance.Width, td1.Y - tolerance.Height);
if (ed1.Contains(hitPoint))
{
return new AnchorPoint(linkShape, segment, shape1, tolerance, flag1);
}
}
}
return null;
}