Closed tim-kilian closed 5 years ago
Also take a look at the line width and size, that does not match.
Overlapping both images results in: Seems like there is something wrong with the place
Exported drawing:
<pnml xmlns="http://www.pnml.org/version-2009/grammar/pnml">
<net xmlns="" id="net_1563094823731" type="http://www.pnml.org/version-2009/grammar/pnml">
<place id="1">
<graphics>
<position x="297" y="317"/>
<dimension x="40" y="40"/>
</graphics>
</place>
<transition id="2">
<graphics>
<position x="470" y="321"/>
<dimension x="48" y="32"/>
</graphics>
</transition>
<place id="3">
<graphics>
<position x="474" y="425"/>
<dimension x="40" y="40"/>
</graphics>
</place>
<transition id="4">
<graphics>
<position x="293" y="429"/>
<dimension x="48" y="32"/>
</graphics>
</transition>
<arc id="5" source="1" target="2">
<graphics/>
</arc>
<arc id="6" source="2" target="3">
<graphics/>
</arc>
<arc id="7" source="3" target="4">
<graphics/>
</arc>
<arc id="8" source="4" target="1">
<graphics/>
</arc>
</net>
</pnml>
The same file from renew exported:
<pnml xmlns="RefNet">
<net id="netId1563095092211" type="RefNet">
<place id="1">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<graphics>
<position x="297" y="317"/>
<dimension x="40" y="40"/>
<fill color="rgb(112,219,147)"/>
<line color="rgb(0,0,0)"/>
</graphics>
</place>
<place id="3">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<graphics>
<position x="474" y="425"/>
<dimension x="40" y="40"/>
<fill color="rgb(112,219,147)"/>
<line color="rgb(0,0,0)"/>
</graphics>
</place>
<transition id="2">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<graphics>
<position x="470" y="321"/>
<dimension x="48" y="32"/>
<fill color="rgb(112,219,147)"/>
<line color="rgb(0,0,0)"/>
</graphics>
</transition>
<transition id="4">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<graphics>
<position x="293" y="429"/>
<dimension x="48" y="32"/>
<fill color="rgb(112,219,147)"/>
<line color="rgb(0,0,0)"/>
</graphics>
</transition>
<arc id="5" source="1" target="2">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<type>
<text>ordinary</text>
</type>
<graphics>
<line color="rgb(0,0,0)" style="solid"/>
</graphics>
</arc>
<arc id="6" source="2" target="3">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<type>
<text>ordinary</text>
</type>
<graphics>
<line color="rgb(0,0,0)" style="solid"/>
</graphics>
</arc>
<arc id="7" source="3" target="4">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<type>
<text>ordinary</text>
</type>
<graphics>
<line color="rgb(0,0,0)" style="solid"/>
</graphics>
</arc>
<arc id="8" source="4" target="1">
<label>
<graphics>
<offset x="0" y="0"/>
</graphics>
<text></text>
</label>
<type>
<text>ordinary</text>
</type>
<graphics>
<line color="rgb(0,0,0)" style="solid"/>
</graphics>
</arc>
<name>
<text>untitled</text>
</name>
</net>
</pnml>
From the source Code of renew:
Point location = getLocation();
Point bottomRight = getGraphic().getDimension();
if (bottomRight == null) {
bottomRight = new Point(20, 20);
}
moveObject(location.x - (bottomRight.x / 2), location.y - (bottomRight.y / 2));
This moveObject is doing wrong. That shouldn't be there.
The PNML specification shows that the coordinated of the objects are ineed at the center position, not in the top left corner. They call it bendpoints.
Future tracked by renew-js/renew-formalism-pt#18
Describe the bug
When you try to import a pnml in renew it does not look like in renew-js.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should look the same
Screenshots