BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
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
Hi Mohammad,
We have validated your requirement of “Need to find two Nodes are overlapped with each other”. We have validated the provided code example and do some changes in that code to find the nodes are overlapped or not. Please find the codes to find the nodes are overlapped or not.
if (existNodeTopLeft.X >= addedNodeBottomRight.X || existNodeTopLeft.Y <= addedNodeBottomRight.Y || existNodeBottomRight.X >= addedNodeTopLeft.X || existNodeTopLeft.Y >= addedNodeBottomRight.Y || existNodeTopLeft.X <= addedNodeBottomRight.X || existNodeBottomRight.Y >= addedNodeTopLeft.Y || existNodeBottomRight.X >= addedNodeTopLeft.X || existNodeBottomRight.Y >= addedNodeTopLeft.Y) { return true; }
return false;
|
Regards,
Karkuvel Rajan S