Adding nodes to invisible layer issue

Hello,

When I add a node to an invisible layer, it is not visible when the layer has its property changed to visible. If I add more nodes to this layer once the layer is visible than any nodes that were added before the layer was made visible will appear along with the nodes that were just added.

This seems like some kind of update issue so I tried:

layer.visible = false;
Diagram.model.startTransaction(“add node”);
//added node here
Diagram.model.commitTransaction(“add node”)
layer.visible = true;

Unfortunately this didn’t make the node appear so any help on what update function I’m missing would help.

Thanks!

We’ll look into this in a while – we’re dealing with weather at the moment.

One comment I have: you should put all of the modification code inside the transaction – including changing the Layer.visible property.

The nodes are being added by clicking a button on a context menu and the visibility of the layer is toggled by clicking a checkbox in a treeview which unfortunately is not able to be part of the same transaction. For example click the context menu to add a node to an invisible layer and then click the checkbox in the treeview to make the layer/node appear. I tried making a transaction around the adding of the node and making another transaction around making the layer visible but that didn’t work.

I have other pieces I can work on in the meantime so no worries on weather permitting speed of response.

This was a bug with setting layer visibility. It’s been fixed and will be in the 1.3.4 release (which should be out in a week or less).

If you need a workaround in the meantime let me know and we’ll try to work something out.

Nah, next week is fine. I was in the process of forcing a refresh on a context menu button click but it sounds like I won’t need to create the work around.

Thanks for the rapid help Simon!