本文整理汇总了C#中IDiagramPresenter.InvalidateDiagram方法的典型用法代码示例。如果您正苦于以下问题:C# IDiagramPresenter.InvalidateDiagram方法的具体用法?C# IDiagramPresenter.InvalidateDiagram怎么用?C# IDiagramPresenter.InvalidateDiagram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDiagramPresenter
的用法示例。
在下文中一共展示了IDiagramPresenter.InvalidateDiagram方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvalidateAnglePreview
private void InvalidateAnglePreview(IDiagramPresenter diagramPresenter) {
// invalidate previous angle preview
diagramPresenter.InvalidateDiagram(
rectBuffer.X - rectBuffer.Width - diagramPresenter.GripSize,
rectBuffer.Y - rectBuffer.Height - diagramPresenter.GripSize,
rectBuffer.Width + rectBuffer.Width + (2 * diagramPresenter.GripSize),
rectBuffer.Height + rectBuffer.Height + (2 * diagramPresenter.GripSize));
int requiredDistance;
diagramPresenter.ControlToDiagram(diagramPresenter.MinRotateRange, out requiredDistance);
int length = (int)Math.Round(Geometry.DistancePointPoint(ActionStartMouseState.X, ActionStartMouseState.Y, CurrentMouseState.X, CurrentMouseState.Y));
// invalidate current angle preview / instruction preview
rectBuffer.Location = ActionStartMouseState.Position;
if (length > requiredDistance)
rectBuffer.Width = rectBuffer.Height = length;
else
rectBuffer.Width = rectBuffer.Height = requiredDistance;
diagramPresenter.InvalidateDiagram(rectBuffer.X - rectBuffer.Width, rectBuffer.Y - rectBuffer.Height, rectBuffer.Width + rectBuffer.Width, rectBuffer.Height + rectBuffer.Height);
}
示例2: Invalidate
/// <override></override>
public override void Invalidate(IDiagramPresenter diagramPresenter)
{
if (diagramPresenter == null) throw new ArgumentNullException("diagramPresenter");
int x = int.MaxValue;
int y = int.MaxValue;
int width = int.MinValue;
int height = int.MinValue;
if (strokeSet.Count > 0)
GetStrokeSetBounds(out x, out y, out width, out height);
// invalidate Stroke(s)
foreach (Point p in currentStroke) {
if (p.X < x) x = p.X;
if (p.Y < y) y = p.Y;
if (p.X > x + width) width = p.X - x;
if (p.Y > y + height) height = p.Y - y;
}
if (diagramPresenter != null) {
diagramPresenter.ControlToDiagram(rect, out rect);
if (strokeSet.Count > 0 || currentStroke.Count > 0)
diagramPresenter.InvalidateDiagram(x, y, width, height);
}
}