mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#911 Fixed picking on category legend
This commit is contained in:
@@ -720,6 +720,26 @@ caf::PdmObject* RiuViewer::lastPickedObject() const
|
||||
return m_viewerCommands->currentPickedObject();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::OverlayItem* RiuViewer::pickFixedPositionedLegend(int winPosX, int winPosY)
|
||||
{
|
||||
int translatedMousePosX = winPosX;
|
||||
int translatedMousePosY = height() - winPosY;
|
||||
|
||||
for (auto overlayItem : m_visibleLegends)
|
||||
{
|
||||
if (overlayItem->layoutScheme() == cvf::OverlayItem::FIXED_POSITION &&
|
||||
overlayItem->pick(translatedMousePosX, translatedMousePosY, overlayItem->fixedPosition(), overlayItem->sizeHint()))
|
||||
{
|
||||
return overlayItem.p();
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user