mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 12:10:57 -06:00
#552 Linked Views : Draw a cross hair marker
This commit is contained in:
parent
2b17366310
commit
4583dbf3b1
@ -422,10 +422,13 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
|
|||||||
if (mainCamera()->project(displayCoord, &screenCoords))
|
if (mainCamera()->project(displayCoord, &screenCoords))
|
||||||
{
|
{
|
||||||
int translatedMousePosY = height() - screenCoords.y();
|
int translatedMousePosY = height() - screenCoords.y();
|
||||||
QPoint pos(screenCoords.x(), translatedMousePosY);
|
QPoint centerPos(screenCoords.x(), translatedMousePosY);
|
||||||
|
|
||||||
QLabel test("x");
|
// Draw a cross hair marker
|
||||||
test.render(painter, pos);
|
int markerHalfLength = 6;
|
||||||
|
|
||||||
|
painter->drawLine(centerPos.x(), centerPos.y() - markerHalfLength, centerPos.x(), centerPos.y() + markerHalfLength);
|
||||||
|
painter->drawLine(centerPos.x() - markerHalfLength, centerPos.y(), centerPos.x() + markerHalfLength, centerPos.y());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user