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
|
Hello We have a problem with loading diagrams. We updated WpfDiagramming.Foundation from version 2.0 to 3.0 in our product, we see that some diagrams cannot be loaded. We get an ArgumentException says that "the length cannot be negative". You can find the stack trace attached. Could you please take a look at this? //Dmitry |
|
|
Hello Dmitry I couldn't reproduce the issue, but I have used the stack trace to prevent this exception occurring again. This will be available in the next nightly build. Let me know if there are further issues. Jason Fauchelle |
|
|
Hello Jason Unfortunately your fix didn't solve the problem, we still get the exception about negative width. Is it possible to add a check before set the width?I think it could solve the issue. Dmitry |
|
|
Hello Dmitry In the fix I made, every point in the SnapLineDrawingConverter that sets the width or height of a Rect makes sure that the values are not negative. I have tested this by passing in negative values to the converter and this does not result in a crash or errors output to the console. Make sure that your project is using the dll from the latest WPF Diagrams install. If it is, please repost the stack trace as the exception may be occurring somewhere else now. Jason Fauchelle |
|
|
Hello Jason I've attached the new stack trace. It looks the same but with only one difference. I hope it can help. Dmitry |
|
|
Hello Dmitry Sorry this simple issue is taking a while to track down. The new stack trace still shows this is the exact same issue unlike what I was hoping for. I have not looked into it again today but will have another go tomorrow. In the meantime, if it's not too hard to build a repro project, it would be a huge help. Note that this error should not be related to the diagram you are loading, it is related to rendering the background grid lines, so your repro project should not need to use any of your custom diagram related model classes. The issue may be related to how the DiagramSurface is being setup or from any custom styles being applied to the DiagramSurface control. Jason Fauchelle |
|
|
Hello Dmitry This issue was probably caused by a NaN value being passed into the converter and then cast to an integer which produces a negative value. This will be resolved in the next nightly build. Jason Fauchelle |
|
|
Hello Jason I tested the last nightly build and there is no problem with the exception there. Thank you. But I found the following strange behaviour: when I load my big diagram I see that its bounds cannot be calculated properly. I cannot navigate or scroll the diagram. Please take a look at the attached picture, as you can see, the scrolls are disabled. Is it a bug? Or may be I need to "ask" the surface somehow to recalculate the diagram bounds? Dmitry |
|
|
Hello Dmitry This is a bug but I have not been able to reproduce this. Unfortunately I may require a repro project to investigate this one. If you load a different diagram that is also larger than the vieport, do the scroll bars appear correctly? Jason Fauchelle |
|
|
Hello Jason Yes, if I load another diagram that larger than the viewport, there is no problem. The problem appears for some huge diagrams with a lot of elements. Earlier these diagrams cause the exception, but now there is no exception, just incorrect bounds. I see that DiagramBounds property of the surface has NaN values after loading of such diagrams. I'll try to create a repro project if needed. Dmitry |
|
|
Hello Dmitry Thanks for mentioning the NaN values. If you are able to, please send me the file containing the loading data for one of the diagrams that causes this problem. I may be able to use the node and connection position data to simulate this issue at my end. This would be a lot easier for you than building a repro. I can not guarantee I could reproduce it from this file alone, but it will be the best chance. I will be away next week, so if you do have time to build a repro project that would be much appreciated. Jason Fauchelle |
|
|
Hello Jason I sent a repro project with some explanations by email. Please let me know if you have any problems with it. Dmitry |
|
|
Hello Dmitry Thanks for the repro project and your observations about connection-mounted connections. I was easily able to reproduce and resolve this issue which will be fixed in the next nightly build. Jason Fauchelle |
|
|
Hello Jason Thank you! Well done! Dmitry |
|
|
Hello I faced with almost the same problem again. I see NaN values for DiagramBounds. I attached the repro project. Steps to reproduce:
I hope it can help you to reproduce the problem. Please ask me if you have any questions or need some help to reproduce. Dmitry |
|
|
Hello Dmitry Thanks for brining this to our attention and sending the repro project. This helped a lot. This issue has been resolved which you can update through the next nightly build. -Jason Fauchelle |
|