Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LinkSegments issue and workaround (Read 3835 times)
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
LinkSegments issue and workaround
May 31st, 2010 at 4:08pm
Print Post  
I have created a database application that stores diagram information in a database. It works great for the most part, but I noticed a bug that made my heart stop when I first encountered it. I found a workaround but I wanted to give you a heads-up about it.

I store the control points for a link in a table and render them when the diagram is loaded using the ControlPoints.Add() and UpdateFromPoints() methods. I also gave the user the ability to add or delete link segments as desired. The problem occurs when the user deletes a segment so the number of segments for a link is less than the Diagram's LinkSegments setting. Wnen this happens, the diagram just becomes a big red "X" surrounded by a red box border. Like I said, heartstopping! The version number of the MindFusion.Diagramming assemby is 5.3.5.25867.

After playing around with the program, I discovered that if I set the Diagram's LinkSegments to 1 that fixed the problem. So I implemented logic like the following to fix:

Dim shtCurrentLinkSegments As Short ' To hold current value of Diagram's LinkSegments
shtCurrentLinkSegments = dgm.LinkSegments
dgm.LinkSegments = 1

<< Diagram rendering logic here >>

dgm.LinkSegments = shtCurrentLinkSegments ' Restore Diagram's original LinkSegments setting


It is interesting that this worked because the links are correctly rendered while the temporary LinkSegments value is in effect and the diagram displays them even after LinkSegments is reset to the original value.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkSegments issue and workaround
Reply #1 - May 31st, 2010 at 4:46pm
Print Post  
Are you calling the UpdateFromPoints method that takes two arguments, with updateSegmentCount enabled?
  
Back to top
 
IP Logged
 
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Re: LinkSegments issue and workaround
Reply #2 - May 31st, 2010 at 8:30pm
Print Post  
Yes! Much better. After I posted about the 'bug' I realized my fix did not render the diagram correctly if it contained more segments than the LinkSegments setting. But using the 2-parameter UpdateFromPoints() method seems to have fixed everything.

So there is no bug. Feel free to remove this thread from the 'Bug Report' as it is just clutter.

Thanks loads.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint