Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic shapeNode.Bounds are lost when using setShape (Read 2111 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
shapeNode.Bounds are lost when using setShape
Jan 19th, 2013 at 1:41pm
Print Post  
When I use node.setShape(shape) and then diagram.repaint(), the changed node gets really big.

I workaround with:
var savedBounds = node.getBounds();
node.setShape(shapeID);
node.setBounds(savedBounds)

But shouln't bounds stay the same?

Also when I use:
node.setBrush(newbrush)
node.setTextColor(c)
node.setShape(shapeID)
the canges are only visible after using diagram.repaint().

Is this intended behaviour?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: shapeNode.Bounds are lost when using setShape
Reply #1 - Jan 20th, 2013 at 10:29am
Print Post  
setShape does not invalidate the node correctly. Use this as a work-around instead, to avoid repainting the whole diagram:

Code
Select All
node.setShape(shapeId);
node.invalidate(); 



or move the setShape methods before the brush / color setter calls.

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