Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link text disappearing sometimes (Read 5446 times)
Dominic Hoffmann
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Mar 19th, 2013
Link text disappearing sometimes
May 2nd, 2013 at 10:07am
Print Post  
Hi,

i'm having some trouble with the link text displayed to the user.
I'm changing the FontWeight to Heavy and setting Textbrush to Black, if a Link gets selected.

Sometimes it is happening, that the Link Text is disappearing. But if i drag and drop that particular Link, the Text gets displayed with the correct settings as mentioned.

Some ideas what could be the reason for this?

Thanks,
Dom
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link text disappearing sometimes
Reply #1 - May 2nd, 2013 at 10:16am
Print Post  
Hi,

The control might not be refreshing its cached text layout structures when you change FontWeight. Try calling the UpdateFromPoints method after changing weight as a work-around. UpdateFromPoints should recalculate all text layout information based on current font attributes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Dominic Hoffmann
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Mar 19th, 2013
Re: Link text disappearing sometimes
Reply #2 - May 2nd, 2013 at 11:11am
Print Post  
Thanks for your Reply. Calling UpdateFromPoints unfortunatelly didn't solve the Problem.
But calling Layout.Arrange after Selecting a Link did.

But i'm not quite sure if this is the best way. I'm feeling like i am throwing rocks for hitting a needle.  Smiley
In German you would say (translated free) Shooting with canons after birds.

Maybe you have another idea?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link text disappearing sometimes
Reply #3 - May 2nd, 2013 at 11:20am
Print Post  
How are you displaying link texts actually? By setting link.Text property, using LinkLabels, or some custom method (such as custom drawing or attached nodes)?
  
Back to top
 
IP Logged
 
Dominic Hoffmann
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Mar 19th, 2013
Re: Link text disappearing sometimes
Reply #4 - May 2nd, 2013 at 11:26am
Print Post  
I am displaying the link text by setting link.text Property.
I don't have any custom draw method.
The links are (of course) connected to shapenodes which are added to different SwimlaneLayoutTrait Lanes.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link text disappearing sometimes
Reply #5 - May 2nd, 2013 at 11:38am
Print Post  
What TextStyle value are you using? Does it show the text if you follow the link.UpdateFromPoints call with link.InvalidateMeasure()?
  
Back to top
 
IP Logged
 
Dominic Hoffmann
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Mar 19th, 2013
Re: Link text disappearing sometimes
Reply #6 - May 2nd, 2013 at 12:27pm
Print Post  
i am using LinkTextStyle = LinkTextStyle.Rotate;

Here are my whole diagram settings i am initialy applying.

Code (C++)
Select All
                diagram.Behavior = Behavior.DrawShapes | Behavior.LinkShapes;

            diagram.RouteLinks = true;
            diagram.LinkRouter = new GridRouter();
            diagram.LinkRouter.Diagram = diagram;

            diagram.Width = 3840;
            diagram.Height = 3840;
            diagram.Bounds = new Rect(0, 0, 3840, 3840);
            diagram.DelKeyAction = DelKeyAction.None;

            diagram.AllowInplaceEdit = true;
            diagram.AllowSelfLoops = false;
            diagram.RestrictItemsToBounds = RestrictToBounds.InsideOnly;

            diagram.LinkTextStyle = LinkTextStyle.Rotate;
            diagram.LinkShape = LinkShape.Bezier;
            diagram.CrossingRadius = 20;
            diagram.LinkCrossings = LinkCrossings.Straight;
            diagram.AllowMultipleResize = true;
            diagram.RoundedLinks = false;

            diagram.NodeEffects.Add(new GlassEffect());
            diagram.NodeEffects.Add(new AeroEffect());

            diagram.ShowAnchors = ShowAnchors.Always; 



And these are the link settings for every link

Code (C++)
Select All
                link.AutoSnapToNode = false;
                link.UseLayoutRounding = false;
                link.DrawCrossings = true;
                link.Dynamic = false;
                link.Shape = LinkShape.Cascading;
                link.TextStyle = LinkTextStyle.Rotate;
                link.IgnoreLayout = false;
                link.TextBrush = Brushes.Gray;
                link.Stroke = Brushes.Gray;
                link.HeadStroke = Brushes.Gray; 



i tried with
link.UpdateFromPoints();
link.InvalidateMeasure();

as you have mentioned, but it didn't change the result.

I discovered, it must have some to do with the FontWeight set to Heavy or Bold.

If i don't set the FontWeight, the text is displayed at every time and is not disappearing as it at some particular links does (not at all of them inside the diagram) if i set FontWeight.
Maybe something with measuring the heigth of the link text ?
But this should get fixed by link.UpdateFromPoints();
link.InvalidateMeasure();, right ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link text disappearing sometimes
Reply #7 - May 3rd, 2013 at 8:02am
Print Post  
I could not reproduce it neither with Heavy nor Bold weights. Could you save the diagram right after the text disappears and attach the file here?
  
Back to top
 
IP Logged
 
Dominic Hoffmann
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Mar 19th, 2013
Re: Link text disappearing sometimes
Reply #8 - May 3rd, 2013 at 12:23pm
Print Post  
How do i save it?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link text disappearing sometimes
Reply #9 - May 3rd, 2013 at 2:26pm
Print Post  
Call diagram.SaveToXml().
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint