fix i/o ports visually breaking on rename

portability/boost
zetaPRIME 2019-01-02 04:16:45 -05:00
parent 0427e25467
commit f06679d221
3 changed files with 7 additions and 3 deletions

View File

@ -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));

View File

@ -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 {

View File

@ -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;