Different errors on diagram while scaling decision

Hello!


I use Aspose.Diagram to create different telecom connections schemes. One page can include from approximately 20 shapes to several thousand shapes. Also there are connection points and connectors.

In common scheme generation works well. Impressive beautiful layouts are generated with your library. But every now and then I see that few shapes on a layout are placed erroneously. Sometimes a shape is placed with wrong coordinates, sometimes a shape is drawn with wrong height or wrong width. It is not easy to reproduce these cases becasuse I do not understand the certain input data sets when this happens.


I will try to reproduce these issues by generating different layouts and scaling them by increasing the number of shapes.
In my first snippet there is a simple drawn rectangle and ports on it. When you launch it you will be asked for the number of port shapes in the switch shape. When the number is 1 <= x <=18 it is drawn well. But when the number is over 19 something goes wrong. Please, try to find the cause of the problem. Thank you.

Aspose_PortsShifted_20_11.zip (156 Bytes)

@Viktor1983
Thank you for your inquiry.
It seems that the sample code is missing,the file in zip is empty.
Could you please share your current code that you are using,We will evaluate your issue further.

I’m sorry. Here is it.
Aspose_PortsShifted_20_11.zip (982 Bytes)

@Viktor1983
Thanks for the sample code.
After an initial testing, I am able to reproduce the issue as you mentioned by using your template file. I found when the number is over 19,the position of shape goes wrong.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53231

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as DIAGRAMNET-53231) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hi, @philip.zhou !

I have added on the layout a shape “vertical switch” with ports with link indications in circles. Here problems start when the input port quantity is 54 or higher. The switch shape X axis is erroneously moved to the right.
Also when the port quantity is over 54 then there comes a problem with line shapes on the “horizontal switch”. Select all (ctrl+a) and move the selected. You will see that line shapes do not move.

Please, resolve it.

AsposeGenerateScaling_150224.zip (1.4 KB)

@Viktor1983
Thanks for the sample code.
After an initial testing, I am able to reproduce the issue as you mentioned by using your sample code.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53277

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as DIAGRAMNET-53277) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Hello!

I think I have found the main reason why shapes sometimes loose coordinates.
I can not easily reproduce it in a code snippet because the error occurrance happens in dependence on at which exact coordinates the problem shape is placed. But I have prepared some data from my production application.
Coordinates Autochange.zip (31.1 KB)
Please, open CircleFirst.png. You see the correct layout with ports on switch with cables (made by DrawLine method) and label shapes with indication of appropriate cable names (made by placing a copy from the “Circle” master shape). It is drawn correctly but I need to draw label shapes over cable shapes. So I move the method to draw the line before the method to paste the label shape. See the result in LineFirst.png. It is placed properly but this time one of the shapes (label #3) has erroneously changes coordinates. It moved a bit to the left and significantly moved to the bottom.

In Coordinates Data.txt I pasted coordinates of shapes. For the line shape I placed input coordinates for the DrawLine method. For the circle shape I placed both input and output (taken by shape.XForm.PinX/PinY) coordinates. I highlighted the data for the third item (line and label). Here we do not see a change. One suspicious thing is the Y coordinate value for Circle #3 is the last negative one in the range. The Y coordinate of Circle #4 is positive.


So I suppose, the problem happens when:

  • A shape is placed over another shape with identical X or Y coordinate.
  • One of the coordinates (true at least about Y) is negative and stands close to some margin after which coordinate turn to positive and starts to increase.


    Please, diagnose it and write your feedback. Thank you.

@Viktor1983
Thanks for the screenshots.
We’ve noticed an incorrect circle in LineFirst.png, and we’re unsure how it occurred. (If you could provide some code snippets, that would be helpful.)
I suggest trying the following code to adjust the order of shapes without rearranging the lines and circles.

shape.SendToBack();
shape.BringToFront();

Thanks.