public override void BeginSnap(GraphElement selectedElement) { if (IsActive) { throw new InvalidOperationException("SnapStrategy.BeginSnap: Snap to spacing already active. Call EndSnap() first."); } IsActive = true; if (m_LineView == null) { m_LineView = new LineView(); } m_GraphView = selectedElement.GetFirstAncestorOfType <UGraphView>(); m_GraphView.Add(m_LineView); }
public override void BeginSnap(GraphElement selectedElement) { //if (IsActive) { // throw new InvalidOperationException("SnapStrategy.BeginSnap: Snap to borders already active. Call EndSnap() first."); //} IsActive = true; if (m_LineView == null) { m_LineView = new LineView(); } m_GraphView = selectedElement.GetFirstAncestorOfType <UGraphView>(); m_GraphView.Add(m_LineView); m_SnappableRects = GetNotSelectedElementRectsInView(selectedElement); }