fix: edge bounds
This commit is contained in:
@@ -13,8 +13,7 @@ FloatingEdgeGraphic::FloatingEdgeGraphic(SocketGraphic* socket1, QGraphicsItem *
|
||||
|
||||
QRectF FloatingEdgeGraphic::boundingRect() const
|
||||
{
|
||||
// TODO: fix
|
||||
auto boundRect = QRect(10,10,10,10);
|
||||
auto boundRect = QRectF(socket1_->scenePos(), floatPos_).normalized();
|
||||
return boundRect;
|
||||
}
|
||||
|
||||
@@ -22,6 +21,7 @@ void FloatingEdgeGraphic::paint(QPainter *painter, const QStyleOptionGraphicsIte
|
||||
{
|
||||
// auto pen = QPen("white");
|
||||
|
||||
std::cout << "draw\n";
|
||||
QLinearGradient gradient(socket1_->scenePos(), floatPos_);
|
||||
gradient.setColorAt(0.0, QColor(255, 255, 255, 255));
|
||||
gradient.setColorAt(1.0, QColor(255, 255, 255, 50));
|
||||
@@ -34,5 +34,10 @@ void FloatingEdgeGraphic::paint(QPainter *painter, const QStyleOptionGraphicsIte
|
||||
|
||||
}
|
||||
|
||||
void FloatingEdgeGraphic::setFloatPos(QPointF floatPos) { floatPos_ = floatPos; }
|
||||
void FloatingEdgeGraphic::setFloatPos(QPointF floatPos) {
|
||||
std::cout << "moving" << floatPos.x() << " " << floatPos.y() << "\n";
|
||||
prepareGeometryChange();
|
||||
floatPos_ = floatPos;
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user