Ejemplo n.º 1
0
 public override void DeleteObject()
 {
     _currentHoverData.UpdateBezierSegment(null);
     _program.Delete(_currentPathObject);
     _currentHoveredSegment = null;
     _program.SetPathObjectUpdate(true);
 }
Ejemplo n.º 2
0
    void UpdateHoverData(ref HoverData hoverData, BezierSegment segment, int index)
    {
        if (hoverData.HoveredBeziersegment == segment)
        {
            return;
        }

        hoverData.HoveredSegmentIndex = index;
        hoverData.UpdateBezierSegment(segment);
    }
Ejemplo n.º 3
0
    public bool MouseOverPathHandles(Vector2 mousePosition, ref HoverData hoverData)
    {
        bool isSecondHandle = Vector2.Distance(mousePosition, SecondHandle) <= 6.5f;

        if (isSecondHandle ||
            Vector2.Distance(mousePosition, FirstHandle) <= 6.5f)
        {
            hoverData.IsSecondHandleHovered = isSecondHandle;
            hoverData.UpdateBezierSegment(this);

            FirstHandleHovered  = !isSecondHandle;
            SecondHandleHovered = isSecondHandle;
            return(true);
        }
        return(false);
    }
Ejemplo n.º 4
0
    public bool MouseOverSegmentPoints(Vector2 mousePosition, ref HoverData hoverData)
    {
        for (int i = 0; i < SegmentPoints.Count; i++)
        {
            if (Vector2.Distance(mousePosition, SegmentPoints[i]) <= 3f)
            {
                if (hoverData.HoveredBeziersegment != null &&
                    hoverData.HoveredBeziersegment.PointHovered)
                {
                    hoverData.HoveredBeziersegment.PointHovered = false;
                }

                hoverData.HoveredSegmentPointIndex = i + 1;
                hoverData.UpdateBezierSegment(this);
                return(true);
            }
        }
        return(false);
    }