我想让矩形的少数或单边在 Graphiti 中可调整大小。如果有人有任何想法,请帮助我。
提前致谢。
在 1.0.0 版本中,您可以覆盖Figure.showResizeHandles方法。有关示例,请参见 HorizontalBus 图
/**
* @method
* Callback to update the visibility of the resize handles
*
* @param {graphiti.Canvas} canvas
* @param {graphiti.ResizeHandle} resizeHandle1 topLeft resize handle
* @param {graphiti.ResizeHandle} resizeHandle2 topCenter resize handle
* @param {graphiti.ResizeHandle} resizeHandle3 topRight resize handle
* @param {graphiti.ResizeHandle} resizeHandle4 rightMiddle resize handle
* @param {graphiti.ResizeHandle} resizeHandle5 bottomRight resize handle
* @param {graphiti.ResizeHandle} resizeHandle6 bottomCenter resize handle
* @param {graphiti.ResizeHandle} resizeHandle7 bottomLeft resize handle
* @param {graphiti.ResizeHandle} resizeHandle8 leftMiddle resize handle
* @template
*/
showResizeHandles: function(canvas, resizeHandle1, resizeHandle2, resizeHandle3, resizeHandle4, resizeHandle5, resizeHandle6, resizeHandle7, resizeHandle8)
{
resizeHandle4.setDimension(resizeHandle4.getWidth(), this.getHeight());
resizeHandle8.setDimension(resizeHandle4.getWidth(), this.getHeight());
this._super(canvas, resizeHandle1, resizeHandle2, resizeHandle3, resizeHandle4, resizeHandle5, resizeHandle6, resizeHandle7, resizeHandle8);
resizeHandle1.hide();
resizeHandle2.hide();
resizeHandle3.hide();
resizeHandle5.hide();
resizeHandle6.hide();
resizeHandle7.hide();
},
这将在右侧和左侧创建两个调整大小手柄,并具有父图形的完整高度。
1.0.0 版将于 9 月 17 日发布