好吧,我找到了解决我问题的廉价方法。
首先,我移动的是边界窗格,而不是自身的节点,因此我
更改了此边界
nodeX = node.getBoundsInParent().getMinX();nodeY = node.getBoundsInParent().getMinY();
To this
nodeX = parent.getBoundsInParent().getMinX();nodeY = parent.getBoundsInParent().getMinY();
便宜的修复方法如下:
parent.setLayoutX(newX);parent.setLayoutY(newY);
我只是根据角落大小增加了newX和newY。这使
一切都完美无瑕。
final double offset = RECTANGLE_CORNER_SIZE - 1;parent.setLayoutX(newX + offset);parent.setLayoutY(newY + offset);
我想您可以为自己添加移动矩形和其他调整大小的矩形(N,E,S,W)
,如果没有,我可以为您提供帮助。



