Beispiel #1
0
 public virtual void OnFigureMove(object sender, LocationEventsArgs e)
 {
     if (FigureMoved != null)
     {
         FigureMoved(sender, e);
     }
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        private void OnMarkerMove(object sender, LocationEventsArgs e)
        {
            var ex = e as MarkerEventArgs;

            if (ex != null)
            {
                _points[ex.Index] = new Location(ex.X, ex.Y);
            }
        }
Beispiel #4
0
 public void OnFigureMove(object sender, LocationEventsArgs e)
 {
     FigureMoved(null, new LocationEventsArgs(this.Location.X, this.Location.Y));
 }
Beispiel #5
0
 public void OnFigureMove(object sender, LocationEventsArgs e)
 {
     FigureMoved(sender, e);
 }
Beispiel #6
0
 private void OnLastPointChanged(object sender, LocationEventsArgs e)
 {
     _controlPoints[_controlPoints.Count - 1] = To.LineEnd;
     RecalcLine();
 }
Beispiel #7
0
 private void OnFirstPointChanged(object sender, LocationEventsArgs e)
 {
     _controlPoints[0] = From.LineEnd;
     RecalcLine();
 }