组单元不会最小化为小尺寸

问题描述

我正在为项目使用mxgraph编辑器。从保存的xml加载图形时,组单元不会最小化到较小的大小。但是在创建群组时,它可以正常工作。请参阅以下示例保存的xml。我发现使用mxrectangle类类型而不是mxRectangle类类型调用mxGraph.swapBounds函数

<mxGraphModel><root><Workflow label="" description="" id="0"><mxCell/></Workflow><Layer label="Layer 1" description="" id="1"><mxCell parent="0"/></Layer><Start label="Start" description="Process stars here" id="2"><mxCell style="image=/creator/images/start.png" parent="1" vertex="1"><mxGeometry x="150" y="150" width="32" height="32" as="geometry"/></mxCell></Start><End label="End" description="Process ends here" id="3"><mxCell style="image=/creator/images/end.png" parent="1" vertex="1"><mxGeometry x="950" y="150" width="32" height="32" as="geometry"/></mxCell></End><Component label="" description="" id="4"><mxCell style="image=/creator/images/error.png" parent="1" vertex="1"><mxGeometry x="250" y="150" width="64" height="64" as="geometry"/></mxCell></Component><Link label="" description="" id="5"><mxCell parent="1" source="2" target="4" edge="1"><mxGeometry as="geometry"/></mxCell></Link><Link label="" description="" id="7"><mxCell parent="1" source="4" target="6" edge="1"><mxGeometry as="geometry"/></mxCell></Link><Group label="" description="" id="10"><mxCell style="group" parent="1" vertex="1" connectable="0" collapsed="1"><mxGeometry x="380" y="200" width="244" height="114" as="geometry"><mxRectangle x="380" y="200" width="40" height="40" as="alternateBounds"/></mxGeometry></mxCell></Group><Component label="" description="" id="6"><mxCell style="image=/creator/images/error.png" parent="10" vertex="1"><mxGeometry x="10" y="10" width="64" height="64" as="geometry"/></mxCell></Component><Component label="" description="" id="8"><mxCell style="image=/creator/images/error.png" parent="10" vertex="1"><mxGeometry x="170" y="40" width="64" height="64" as="geometry"/></mxCell></Component><Link label="" description="" id="9"><mxCell parent="10" source="6" target="8" edge="1"><mxGeometry x="-380" y="-200" as="geometry"/></mxCell></Link></root></mxGraphModel>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...