static private OppositeEdge ( EdgeDir dir ) : EdgeDir | ||
dir | EdgeDir | |
Результат | EdgeDir |
private static bool ShouldEdgesSnap(SnapEdge a, SnapEdge b) { if ((a.dir == SnapEdge.EdgeDir.CenterX || a.dir == SnapEdge.EdgeDir.CenterY) && a.dir == b.dir) { return(true); } if (a.dir == SnapEdge.OppositeEdge(b.dir)) { return(((double)a.start > (double)b.end ? 1 : ((double)a.end < (double)b.start ? 1 : 0)) == 0); } return(false); }
private static bool ShouldEdgesSnap(SnapEdge a, SnapEdge b) { return(((a.dir == SnapEdge.EdgeDir.CenterX || a.dir == SnapEdge.EdgeDir.CenterY) && a.dir == b.dir) || (a.dir == SnapEdge.OppositeEdge(b.dir) && (a.start <= b.end && a.end >= b.start))); }