public virtual void OnFigureMove(object sender, LocationEventsArgs e) { if (FigureMoved != null) { FigureMoved(sender, e); } }
private void RecalcLine(object sender, LocationEventsArgs e) { Vector2 center = (From.LineEnd + To.LineEnd) * 0.5f; Vector2 lineVector = To.LineEnd - From.LineEnd; lineVector.Normalize(); centerX = center + lineVector * 10; Vector2 orthoVector1; if (0 == lineVector.X) { orthoVector1 = new Vector2(5, 0); } else if (0 == lineVector.Y) { orthoVector1 = new Vector2(0, 5); } else { orthoVector1 = new Vector2(5, -lineVector.X * 5 / lineVector.Y); orthoVector1.Normalize(); orthoVector1 *= 5; } lineEnd1 = center - orthoVector1; lineEnd2 = center + orthoVector1; }
private void OnMarkerMove(object sender, LocationEventsArgs e) { var ex = e as MarkerEventArgs; if (ex != null) { _points[ex.Index] = new Location(ex.X, ex.Y); } }
public void OnFigureMove(object sender, LocationEventsArgs e) { FigureMoved(null, new LocationEventsArgs(this.Location.X, this.Location.Y)); }
public void OnFigureMove(object sender, LocationEventsArgs e) { FigureMoved(sender, e); }
private void OnLastPointChanged(object sender, LocationEventsArgs e) { _controlPoints[_controlPoints.Count - 1] = To.LineEnd; RecalcLine(); }
private void OnFirstPointChanged(object sender, LocationEventsArgs e) { _controlPoints[0] = From.LineEnd; RecalcLine(); }