fix i/o ports visually breaking on rename
parent
0427e25467
commit
f06679d221
|
@ -126,6 +126,7 @@ void IOPort::onGadgetCreated() {
|
|||
if (!obj) return;
|
||||
|
||||
obj->customChrome = true;
|
||||
obj->autoPositionPorts = false;
|
||||
qreal ps = (PortObject::portSize + PortObject::portSpacing) * 2;
|
||||
obj->setGadgetSize(QPointF(ps, ps));
|
||||
|
||||
|
|
|
@ -298,9 +298,11 @@ void NodeObject::updateGeometry() {
|
|||
if (showName) contents->setPos(edgePad, edgePad + nameSize());
|
||||
else contents->setPos(edgePad, edgePad);
|
||||
|
||||
qreal pm = PortObject::portSize * .5 + PortObject::portSpacing;
|
||||
if (inputPortContainer) inputPortContainer->setPos(QPointF(-pm, PortObject::portSize));
|
||||
if (outputPortContainer) outputPortContainer->setPos(QPointF(boundingRect().width() + pm, PortObject::portSize));
|
||||
if (autoPositionPorts) {
|
||||
qreal pm = PortObject::portSize * .5 + PortObject::portSpacing;
|
||||
if (inputPortContainer) inputPortContainer->setPos(QPointF(-pm, PortObject::portSize));
|
||||
if (outputPortContainer) outputPortContainer->setPos(QPointF(boundingRect().width() + pm, PortObject::portSize));
|
||||
}
|
||||
}
|
||||
|
||||
qreal NodeObject::nameSize() const {
|
||||
|
|
|
@ -101,6 +101,7 @@ namespace Xybrid::UI {
|
|||
std::unique_ptr<QGraphicsItem> outputPortContainer = nullptr;
|
||||
|
||||
bool customChrome = false;
|
||||
bool autoPositionPorts = true;
|
||||
bool canRename = true;
|
||||
bool showName = true;
|
||||
bool showPluginName = true;
|
||||
|
|
Loading…
Reference in New Issue