Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram canvas area is not updated. When set margin. (Read 12044 times)
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Diagram canvas area is not updated. When set margin.
Jan 25th, 2013 at 6:42am
Print Post  
I working with mindfussion.diagramming diagram. i can increase /decrease width and height by using numeric button. code is here

BGBounds = New Rect(spnTemplateLeft.Value, spnTemplateTop.Value,spnTemplateWidth.Value, spnTemplateHeight.Value)
diagram.Bounds = BGBounds
  BGNode.Bounds = BGBounds


It's working fine.

But when increase/decrease left and top numeric button then canvas area(bounds) of diagram is not updated.
I am using this code:
BGBounds = New Rect(spnTemplateLeft.Value, spnTemplateTop.Value,spnTemplateWidth.Value, spnTemplateHeight.Value)
        BGNode.SetBounds(BGBounds, True)
        diagram.Bounds = BGBounds

If set color to diagram background so colored canvas area also not working.

Please help me.

Thanks in advance  Sad
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram canvas area is not updated. When set margin.
Reply #1 - Jan 25th, 2013 at 8:04am
Print Post  
Have you attached all nodes in your diagram to BGNode? In such case calling SetBounds(..., true) will move them together with that node, so you won't notice any difference when changing the diagram and BGNode's origin. Call SetBounds(..., false) to leave child nodes in place and you should see the background move.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram canvas area is not updated. When set margin.
Reply #2 - Jan 25th, 2013 at 8:57am
Print Post  
Or if you meant to extend the diagram to the left or top rather than just moving the origin of its coordinate system, you must add the offset subtracted from left/top to the rectangle's width/height.

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


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Re: Diagram canvas area is not updated. When set margin.
Reply #3 - Jan 30th, 2013 at 11:22am
Print Post  
Hi Stoyo,

I tried with that but I am not getting it properly. Can you please help me on this and if possible a small demo project will be helpful. Waiting for your reply.

Here is the code that I implemented on Left/Top numeric up/down value changed event:

Code
Select All
TemplateWidth = spnTemplateWidth.Value
BGBounds = New Rect(spnTemplateLeft.Value, spnTemplateTop.Value, TemplateWidth, TemplateHeight)

diagram.Bounds = BGBounds
BGNode.SetBounds(diagram.Bounds, True) 




Thanks in advance for your valuable time.
Regards,
Yogendra
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram canvas area is not updated. When set margin.
Reply #4 - Jan 30th, 2013 at 2:30pm
Print Post  
It should look like this if you need to extend to the left/top while right and bottom boundaries remain unchanged:

Code
Select All
dim dx, dy as float
dx = diagram.Bounds.Left - spnTemplateLeft.Value
dy = diagram.Bounds.Top - spnTemplateTop.Value
BGBounds = New Rect(spnTemplateLeft.Value, spnTemplateTop.Value, _
    diagram.Bounds.Width + dx, diagram.Bounds.Height + dy) 



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


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Re: Diagram canvas area is not updated. When set margin.
Reply #5 - Feb 6th, 2013 at 1:59pm
Print Post  
Thanks stoyan
But if there are nodes on diagram so if i increase/decrease left/top then nodes should be moved,
or diagram has some background in color then colored canvas area should be moved.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram canvas area is not updated. When set margin.
Reply #6 - Feb 6th, 2013 at 2:45pm
Print Post  
And what would you expect to happen? Either move the nodes then, or maybe you should place your diagram inside a Silverlight Border element instead of drawing a border inside the diagram.
  
Back to top
 
IP Logged
 
Yogendra
Junior Member
**
Offline


I Love MindFusion!

Posts: 68
Joined: Dec 27th, 2012
Re: Diagram canvas area is not updated. When set margin.
Reply #7 - Feb 7th, 2013 at 1:25pm
Print Post  
Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint