mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4857 Avoid crash in annotations picking whith distorted view
This commit is contained in:
parent
469397bfd1
commit
2702c3b078
@ -1354,17 +1354,20 @@ void RiuViewerCommands::handleTextPicking( int winPosX, int winPosY, cvf::HitIte
|
||||
|
||||
ref<Ray> ray = m_viewer->mainCamera()->rayFromWindowCoordinates( translatedMousePosX, translatedMousePosY );
|
||||
|
||||
for ( size_t pIdx = 0; pIdx < partCollection.size(); ++pIdx )
|
||||
if ( ray.notNull() )
|
||||
{
|
||||
DrawableText* textDrawable = dynamic_cast<DrawableText*>( partCollection[pIdx]->drawable() );
|
||||
if ( textDrawable )
|
||||
for ( size_t pIdx = 0; pIdx < partCollection.size(); ++pIdx )
|
||||
{
|
||||
cvf::Vec3d ppoint;
|
||||
if ( textDrawable->rayIntersect( *ray, *( m_viewer->mainCamera() ), &ppoint ) )
|
||||
DrawableText* textDrawable = dynamic_cast<DrawableText*>(partCollection[pIdx]->drawable());
|
||||
if ( textDrawable )
|
||||
{
|
||||
cvf::ref<HitItem> hitItem = new HitItem( 0, ppoint );
|
||||
hitItem->setPart( partCollection[pIdx].p() );
|
||||
hitItems->add( hitItem.p() );
|
||||
cvf::Vec3d ppoint;
|
||||
if ( textDrawable->rayIntersect(*ray, *(m_viewer->mainCamera()), &ppoint) )
|
||||
{
|
||||
cvf::ref<HitItem> hitItem = new HitItem(0, ppoint);
|
||||
hitItem->setPart(partCollection[pIdx].p());
|
||||
hitItems->add(hitItem.p());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user