Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Method Intersect (Read 2244 times)
pcone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 9th, 2007
Method Intersect
Mar 14th, 2007 at 7:22am
Print Post  
Hi.

I use the method
Arrow.Intersect(Arrow.Origin) and return always true, also when the arrow don't cross trought the box Arrow.Origin.

Why?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Method Intersect
Reply #1 - Mar 14th, 2007 at 8:29am
Print Post  
Hi,

I guess the one common pixel between the arrow and its origin node is enough for Intersects to return true. If you need to know whether the arrow crosses its origin, try using a temporary box slightly smaller (say 0.5mm) than the origin and call Intersects for it.

Stoyan
  
Back to top
 
IP Logged
 
pcone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 9th, 2007
Re: Method Intersect
Reply #2 - Mar 14th, 2007 at 10:45am
Print Post  
Is there e method who delete a Box after i create it?

i use this method:

Code
Select All
public bool Intersect(Arrow a, Box b)
{
Box temp;

temp = this.flow.CreateBox((b.BoundingRect.X)+1,(b.BoundingRect.Y)+1,(b.BoundingRect.Size.Width - 2 ),(b.BoundingRect.Size.Height - 2));

return a.Intersects(temp);

this.flow.DeleteObject((Box)temp);
}
 



but box still remain on the flow chart.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Method Intersect
Reply #3 - Mar 14th, 2007 at 12:05pm
Print Post  
The function returns before DeleteObject executes -

return a.Intersects(temp);
this.flow.DeleteObject((Box)temp);

Stoyan
  
Back to top
 
IP Logged
 
pcone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Mar 9th, 2007
Re: Method Intersect
Reply #4 - Mar 14th, 2007 at 12:26pm
Print Post  
Sorry, i didn't notice!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint