fixed position of scaled/highlighted nodes in node graph (patch from Chozabu)

This commit is contained in:
electron128 2015-07-29 16:49:56 +02:00 committed by cave beat
parent a9ef48d133
commit d004056f67
2 changed files with 4 additions and 3 deletions

View File

@ -404,7 +404,7 @@ void GraphWidget::setNameSearch(QString s)
std::string ns = QString::fromStdString(ni->descString()).toLower().toStdString();
if (ns.find(qs) != std::string::npos) {
std::cout << "found!" << '\n';
//std::cout << "found!" << '\n';
ni->setNodeDrawSize(22);
//std::cout << ni->getNodeDrawSize() << '\n';
} else {

View File

@ -285,7 +285,8 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
painter->setPen(Qt::NoPen);
painter->setBrush(Qt::darkGray);
painter->drawEllipse(-7, -7, mNodeDrawSize, mNodeDrawSize);
int mNodeDrawSize2 = mNodeDrawSize/2;
painter->drawEllipse(-mNodeDrawSize2+3, -mNodeDrawSize2+3, mNodeDrawSize, mNodeDrawSize);
QRadialGradient gradient(-3, -3, 10);
if (option->state & QStyle::State_Sunken)
@ -312,7 +313,7 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
}
painter->setBrush(gradient);
painter->setPen(QPen(Qt::black, 0));
painter->drawEllipse(-10, -10, mNodeDrawSize, mNodeDrawSize);
painter->drawEllipse(-mNodeDrawSize2, -mNodeDrawSize2, mNodeDrawSize, mNodeDrawSize);
painter->drawText(-10, 0, QString::fromUtf8(_desc_string.c_str()));
if (!mDeterminedBB)