This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
In our diagram, we're always creating our DiagramConnectionBase subclass with a ZOrder of 10, and our DiagramNode instances with a ZOrder of 50. However, we often will see a scenario where connections are drawn over the top of nodes. When inspecting the visual tree via Snoop, it appears that the Panel.ZIndex within the DiagramSurface's internal Canvas is not getting set properly. (The numbers appear to be generated based on the creation order, or some other mechanism.) The ZOrder property is being ignored, and we end up with connections over the top of our nodes. |
|
|
Hello Reed Unfortunately I have not been able to reproduce this issue at my end. Would you be able to send a repro project for this? Jason Fauchelle |
|
|
Jason, I'm having difficulty creating a repro - I'll let you know if we figure this out. I suspect the problem may have been with some logic we had with creating/updating connections. Our previous logic (when this was occurring) was often recreating and adding a connection to the model which already existed. Your framework seems to handle this fine (it replaces or ignores the new - not sure which), but I suspect that was what was causing the internal zorder logic to get messed up - since after that would happen a few times, all of a sudden (only sometimes) we'd start seeing the ZIndex being wrong internally. If we figure out how to reliably reproduce, I'll let you know. Now that we've updated our refresh logic and made it more intelligent, so far it seems like this has stopped occurring. -Reed |
|
|
Thanks for the information Reed Good to hear it has stopped occurring. If you notice this issue again, one thing to help reliably reproduce this issue could be to make the ZOrder of your nodes and connections closer together. I've recently run through the ZOrder logic, and I haven't been able to find anything that could indicate 2 items with different ZOrders from getting the wrong ZIndex. Jason Fauchelle |
|
|
We're just using a constant value for the two - so nodes are always one number, and connections always the other (in their constructor) - I'll let you know if it happens again. |
|
|
Unfortunately, this started happening again reliably once we upgraded to Diagrams 3. We're always explicitly making all nodes (a subclass of DiagramNode) and setting this.ZOrder = 50; in the constructor. Connections are made in a similar way (subclass of DiagramConnectionBase When I inspect the items later, the ZOrder property is always 0.0, and ordering is based on time things were added. Using Snoop, the Panel.ZIndex seems to be set to -1 for the first node element, and 0 for the subsequent ones + the connection. We're never touching ZOrder, but I've noticed that if I override methods (such as OnDataChanged), the ZOrder will be 0.0 when they're called, even though I've set it explicitly in the constructor. Any ideas of what I can be doing wrong? I've checked - the constructor of these types is the ONLY place we set ZOrder, and it's always 2 distinct numbers. Panel.ZIndex of the types when rendered is always 0, as is the ZOrder property later if I inspect. I've even tried explicitly setting the style of DiagramNodeElement and DiagramConnectionElement to include Panel.ZIndex sets, but I think they're getting overwritten by the framework. As far as I can tell, the only thing that sets ZOrder, and subsequently Panel.ZIndex, is the ZOrderHelper, but I don't see why these classes would cause that to change... The elements have ZIndex set to -1 or 0 locally, so setting them in a style has no effect. -Reed |
|
|
Hello Reed I'll be looking into this for you tomorrow. Jason |
|
|
Hello Reed I have not been able to fully reproduce this issue. I could see that the Panel.ZIndex was being set to -1 sometimes. This issue has been resolved and will be available in the next nightly build. You should let the framework handle the Panel.ZIndex property - you don't need to manually set them in the styles. I was not able to reproduce the issues with the ZOrder property changing though. The only places in the ZOrderHelper that change the ZOrder is in the 'BringToFront' and 'SendBackward' methods etc. It is possible that the fix I've made today will resolve the issue, so try out the next nightly build first. Let me know if the problem remains - if so, a repro project will be very helpful. Jason Fauchelle |
|
|
Jason - It looks like this fix took care of it. I'm not sure why it caused this behavior, but I removed all of my workarounds, and the April 9th nightly works perfectly in terms of ZOrder now. Thanks for the fix. -Reed |
|