Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramLink StrokeThickness Bug? (Read 2933 times)
jlspublic
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Sep 15th, 2011
DiagramLink StrokeThickness Bug?
Sep 15th, 2011 at 2:38pm
Print Post  
If I set the StrokeThickness of a diagram link then all horizontal and vertical link segments are drawn incorrectly.   They are not the correct thickness and any portion of their arrowheads that extends beyond about three pixels from the center line of the link appears to be truncated.  Links drawn in other orientations are drawn correctly though.

I am using version 2.5.2.32848 of the diagramming component.

Is this a known problem?  Is there a better way of controlling the thickness of the links?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramLink StrokeThickness Bug?
Reply #1 - Sep 15th, 2011 at 2:51pm
Print Post  
Setting StrokeThickness in the demo project works fine for me. There are several horizontal / vertical links there in the first page - can you see this problem if you change their thickness through the property grid?
  
Back to top
 
IP Logged
 
jlspublic
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Sep 15th, 2011
Re: DiagramLink StrokeThickness Bug?
Reply #2 - Sep 15th, 2011 at 6:48pm
Print Post  
Stoyo,

Which demo/sample are you referring to? I'll check if it has the same behavior once I know which one it is.

Meanwhile, here is some simple code that shows the problem on my computer...

XAML:

<ScrollViewer Focusable="False" HorizontalScrollBarVisibility="Auto">
<diag:Diagram
Name="diaSchematic"
AllowDrop="True"
Behavior="DrawLinks"
AutoResize="AllDirections"
GridSizeX="80"
GridSizeY="80"
ShowGrid="True"
GridStyle="Lines"
AlignToGrid="True"
/>
</ScrollViewer>

Code:

Private Sub LoadSchematic(ByVal SchematicUID As Guid)
Dim EndA As New ShapeNode()
EndA.Shape = MindFusion.Diagramming.Wpf.Shape.Shapes.Item(1)
diaSchematic.Nodes.Add(EndA)
EndA.Move(0, 0)

'Diagonal
Dim EndB As New ShapeNode()
EndB.Shape = MindFusion.Diagramming.Wpf.Shape.Shapes.Item(2)
diaSchematic.Nodes.Add(EndB)
EndB.Move(200, 200)
diaSchematic.Bounds = diaSchematic.GetContentBounds(False, False)

Dim Link As New DiagramLink( _
diaSchematic _
, EndA _
, EndB _
)
Link.HeadShape = ArrowHeads.Triangle
diaSchematic.Links.Add(Link)
Link.StrokeThickness = 4

'Horizontal
Dim EndC As New ShapeNode()
EndC.Shape = MindFusion.Diagramming.Wpf.Shape.Shapes.Item(3)
diaSchematic.Nodes.Add(EndC)
EndC.Move(0, 200)
diaSchematic.Bounds = diaSchematic.GetContentBounds(False, False)

Link = New DiagramLink( _
diaSchematic _
, EndA _
, EndC _
)
Link.HeadShape = ArrowHeads.Triangle
diaSchematic.Links.Add(Link)
Link.StrokeThickness = 6

'Vertical
Dim EndD As New ShapeNode()
EndD.Shape = MindFusion.Diagramming.Wpf.Shape.Shapes.Item(4)
diaSchematic.Nodes.Add(EndD)
EndD.Move(200, 0)
diaSchematic.Bounds = diaSchematic.GetContentBounds(False, False)

Link = New DiagramLink( _
diaSchematic _
, EndA _
, EndD _
)
Link.HeadShape = ArrowHeads.Triangle
diaSchematic.Links.Add(Link)
Link.StrokeThickness = 8

End Sub

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramLink StrokeThickness Bug?
Reply #3 - Sep 16th, 2011 at 10:32am
Print Post  
The demo is the one that opens from Start menu / WpfDiagram / Run Demo. Anyway I was able to reproduce this with your code, and think it's the same problem as we had with the Silverlight version here:
http://mindfusion.eu/Forum/YaBB.pl?board=diaglite_disc;action=display;num=129709...

The paths created for the link are bound to all Stroke* properties, but StrokeThickness does not update the path measures as it should. As a workaround, call UpdateFromPoints to force the link paths to be recreated, or set some other property that modifies the link's geometry after setting thickness.

I hope that helps,
Stoyan
« Last Edit: Sep 16th, 2011 at 12:17pm by Stoyo »  
Back to top
 
IP Logged
 
jlspublic
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Sep 15th, 2011
Re: DiagramLink StrokeThickness Bug?
Reply #4 - Sep 16th, 2011 at 11:23am
Print Post  
Stoyo,

Thanks, I never would have figured that out on my own!

By the way, you provide great support.  I hope you get paid a lot!    Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramLink StrokeThickness Bug?
Reply #5 - Sep 16th, 2011 at 12:15pm
Print Post  
I hope that too 8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint