| 1202 | |
| 1203 | void GraphView::CenterView( BaseNode const* pNode ) |
| 1204 | { |
| 1205 | EE_ASSERT( m_pGraph != nullptr ); |
| 1206 | EE_ASSERT( pNode != nullptr && m_pGraph->FindNode( pNode->GetID() ) != nullptr ); |
| 1207 | |
| 1208 | ImVec2 const nodeHalfSize = ( pNode->GetSize() / 2 ); |
| 1209 | ImVec2 const nodeCenter = ImVec2( pNode->GetPosition() ) + nodeHalfSize; |
| 1210 | *m_pViewOffset = nodeCenter - ( m_canvasSize / 2 ); |
| 1211 | } |
| 1212 |
no test coverage detected