Example #1
0
 public override void MouseDown(int xPos, int yPos)
 {
     if (firstEdge == null && highlightedEdge != null)
     {
         firstEdge = highlightedEdge;
         editorForm.Help(help[1]);
     }
     else
     {
         Figures.Edge secondEdge = highlightedEdge;
         if (secondEdge is null || secondEdge == firstEdge)
         {
             return;
         }
         if (firstEdge.RelatedEdge == secondEdge && firstEdge.EnactedRestriction == Figures.Edge.Restriction.SameSize)
         {
             firstEdge.ClearRestriction();
         }
         else
         {
             Figures.Edge.SetRestriction(Figures.Edge.Restriction.SameSize, firstEdge, secondEdge, currentRestrictionColor.ToArgb());
         }
         editorForm.Redraw();
         firstEdge = null;
         currentRestrictionColor = Helper.RandomColor();
         editorForm.Help(help[0]);
     }
 }
Example #2
0
 public override void MouseMove(int xPos, int yPos)
 {
     Figures.Edge newHighlightedEdge = editorForm.SelectEdge(xPos, yPos);
     if (newHighlightedEdge == highlightedEdge)
     {
         return;
     }
     if (firstEdge != null && newHighlightedEdge != null && newHighlightedEdge.parent != firstEdge.parent)
     {
         return;
     }
     highlightedEdge = newHighlightedEdge;
     editorForm.Redraw();
 }