X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.cpp;h=54e3b342daf6c26b45fd5214f72c92d3a1bcb8db;hb=ea7712f342020baf61cf33ba98b12140da6aecf7;hp=8c581bfc1df8e904ccb41bd2b724b26b3c3ae7d5;hpb=4a979ddae8aa6b3556f24e8b961f7787c4b40cbe;p=architektonas diff --git a/src/drawingview.cpp b/src/drawingview.cpp index 8c581bf..54e3b34 100644 --- a/src/drawingview.cpp +++ b/src/drawingview.cpp @@ -49,8 +49,8 @@ DrawingView::DrawingView(QWidget * parent/*= NULL*/): QWidget(parent), useAntialiasing(true), numSelected(0), numHovered(0), shiftDown(false), ctrlDown(false), gridBackground(BACKGROUND_MAX_SIZE, BACKGROUND_MAX_SIZE), - scale(1.0), offsetX(-10), offsetY(-10),// document(Vector(0, 0)), - gridPixels(0), collided(false)//, toolAction(NULL) + scale(1.0), offsetX(-10), offsetY(-10), + gridPixels(0), collided(false), hoveringIntersection(false) { // document.isTopLevelContainer = true; //wtf? doesn't work except in c++11??? document = { 0 }; @@ -324,6 +324,9 @@ void DrawingView::paintEvent(QPaintEvent * /*event*/) painter.DrawRect(Global::selection); } + if (hoveringIntersection) + painter.DrawHandle(intersectionPoint); + if (!informativeText.isEmpty()) painter.DrawInformativeText(informativeText); } @@ -1174,6 +1177,7 @@ void DrawingView::mouseMoveEvent(QMouseEvent * event) Global::selection.setBottomRight(QPointF(point.x, point.y)); // Only needs to be done here, as mouse down is always preceded by movement Global::snapPointIsValid = false; + hoveringIntersection = false; // Scrolling... if (event->buttons() & Qt::MiddleButton) @@ -1226,8 +1230,13 @@ void DrawingView::mouseMoveEvent(QMouseEvent * event) if (numIntersecting > 0) { - QString text = tr("Intersection t=%1, u=%2"); - informativeText = text.arg(t).arg(u); + Vector v1 = Geometry::GetPointForParameter((Object *)hover[0], t); + Vector v2 = Geometry::GetPointForParameter((Object *)hover[1], u); + QString text = tr("Intersection t=%1 (%3, %4), u=%2 (%5, %6)"); + informativeText = text.arg(t).arg(u).arg(v1.x).arg(v1.y).arg(v2.x).arg(v2.y); + + hoveringIntersection = true; + intersectionPoint = v1; } }