Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic links thinkness buggy? (Read 1862 times)
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
links thinkness buggy?
Jun 19th, 2013 at 1:29pm
Print Post  
Hello,

drawing some thicker links with rounded corners, 3-segmented .. but when these are running horizontal, their thickness is not the same thick 10 px as when running vertical?

Code
Select All
(in diagram constructor/init:)

            TransferDiagram.LinkShape = LinkShape.Cascading;
            TransferDiagram.LinkCascadeOrientation = Orientation.Horizontal;
            TransferDiagram.LinkSegments = 3;
            TransferDiagram.RoundedLinks = true;
            TransferDiagram.RoundedLinksRadius = 20;

(drawing by:)

 internal void DrawLink(DiagramNode from, DiagramNode to)
        {
            var link = new DiagramLink(TransferDiagram, from, to); //{ StrokeThickness = linkstrokethickness, Stroke = linkstroke };
            link.StrokeThickness = 10;
            link.Stroke = DetailDiagram.sBrGrayish;
            link.HeadShape = ArrowHeads.None;
            TransferDiagram.LinkSegments = 3;
            //make handles invisible:
            link.HandlesStyle = HandlesStyle.Custom;
            //link.Effect = ActiveNodeEffect; //looks horrible!
            //link.AutoRoute = true; //awful..
            TransferDiagram.LinksDrawn = true;
            TransferDiagram.Links.Add(link);
        } 



if it were not for variable thickness, theyd look nice  Embarrassed
  

connectors_contexts.png (Attachment deleted)
Back to top
 
IP Logged
 
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: links thinkness buggy?
Reply #1 - Jun 19th, 2013 at 3:01pm
Print Post  
OK solved it:


if you use link.CascadeOrientation = Orientation.Horizontal; per link

instead of

TransferDiagram.LinkCascadeOrientation = Orientation.Horizontal; per diagram,

then the thickness overall stays constant...

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: links thinkness buggy?
Reply #2 - Jun 19th, 2013 at 7:17pm
Print Post  
The link's MeasureOverride does include StrokeThickness in the returned size, but setting StrokeThickness might not be triggering a new measure pass, causing WPF to use some outdated clip path for the links. The Orientation setter calls Repaint(), which invalidates the element's measure, so perhaps that's what helps.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint