Hi
I'm Using VS 2022 .Net 6 and syncfusion v : 20.4.0.44
I have problems when I want to detect that Shape Nodes have overlap with each other..
i will be very thankful if anyone can help ...
according to image I've uploaded
step 1 ) first I drop node A on diagram --> works fine
step 2 ) then I drop node B on diagram near node A -- > overlap detected and make an or statement correctly
step 3 ) then I drop Node C on diagram near node B --> diagram does NOT detect overlap and the code does not work as expected.
This function wants to detect Overlap using 4 points ( TopLeft and BottomRight) for each Node.
for step 1 and 2 works fine but not for step 3.
public bool OverlapCheck(PointF addedNodeTopLeft, PointF addedNodeBottomRight, PointF existNodeTopLeft, PointF existNodeBottomRight)
{
if (addedNodeTopLeft.X == addedNodeBottomRight.X ||
addedNodeTopLeft.Y == addedNodeBottomRight.Y ||
existNodeTopLeft.X == existNodeBottomRight.X ||
existNodeTopLeft.Y == existNodeBottomRight.Y)
return false;
if (existNodeTopLeft.X > addedNodeBottomRight.X || addedNodeTopLeft.X > existNodeBottomRight.X)
return false;
if (existNodeBottomRight.Y > addedNodeTopLeft.Y || addedNodeBottomRight.Y > existNodeTopLeft.Y)
return false;
return true;
}
is there any Other way to detect overlapping shape Node???
thanks