Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Grid Points are visible outside the bounded area in the diagram. (Read 11472 times)
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Grid Points are visible outside the bounded area in the diagram.
Jan 21st, 2013 at 5:21am
Print Post  
I am working with mindfussion.diagramming diagram. which is placed in ruler.
Here is code:-
<diag:Ruler Name="ruler"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Width="Auto"
Height="Auto"
Unit="Pixel"
>

<diag:Diagram Name="diagram"
GridSizeX="10"
GridSizeY="10"
BorderThickness="0"
Height="338"
Width="330"
GridColor="Silver"
</diag:Diagram>
</diag:Ruler>


when a load diagram i am creating diagram with bounds,here is code
Private BGBounds As Rect
Dim WithEvents BGNode As MindFusion.Diagramming.Silverlight.ContainerNode
Bounds = New Rect(0, 0, TemplateWidth, TemplateHeight)
BGNode = diagram.Factory.CreateContainerNode(BGBounds)

With diagram
.AutoResize = AutoResize.None
.Behavior = Behavior.Modify
.AlignToGrid = True
.AutoScroll = True
.MeasureUnit = MindFusion.Diagramming.Silverlight.GraphicsUnit.Pixel
.AdjustmentHandlesSize = 10
.ShapeBrush = NodeBrush
.Width = TemplateWidth
.Height = TemplateHeight
.DocumentPlane.Width = TemplateWidth
.DocumentPlane.Height = TemplateHeight
.ShowGrid = True
End With


When bounds show on screen with ruler scale the diagram grids point are not restricted with the ruler scale i.e if I were to set the area of diagram as 500 x 400 the points are still visible outside this area? Please someone suggest how to restrict this? Thanks in advance. Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Grid Points are visible outside the bounded area in the diagram.
Reply #1 - Jan 21st, 2013 at 7:14am
Print Post  
Hi,

Set Diagram.Bounds instead of Width and Height. Bounds calculates width and height based on current MeasureUnit, ZoomFactor and origin of coordinate system, and will also refresh the grid container (which is different from the DocumentPlane you are also setting).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Re: Grid Points are visible outside the bounded area in the diagram.
Reply #2 - Jan 21st, 2013 at 9:39am
Print Post  
Thanks
It's fixed my issue. Smiley
  
Back to top
 
IP Logged
 
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Re: Grid Points are visible outside the bounded area in the diagram.
Reply #3 - Jan 21st, 2013 at 9:46am
Print Post  
Hi Stoyo,
Thanks for your reply, it fixed a hell lot problem I was facing, well I have one more issue with diagram. When I insert any item in the diagram, I can drag that item outside the bounded its area. Is there any possible way to restrict this?  Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Grid Points are visible outside the bounded area in the diagram.
Reply #4 - Jan 21st, 2013 at 1:21pm
Print Post  
Hi,

Set eventArgs.Cancel = true from NodeModifying event handler if you detect the node is not inside diagram.Bounds.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Re: Grid Points are visible outside the bounded area in the diagram.
Reply #5 - Jan 22nd, 2013 at 4:38am
Print Post  
Thanks Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint