@@ -12,23 +12,23 @@ namespace polyscope {
1212
1313PickResult queryPickAtScreenCoords (glm::vec2 screenCoords) {
1414 int xInd, yInd;
15- std::tie (xInd, yInd) = view::screenCoordsToBufferInds (screenCoords);
16- return queryPickAtBufferCoords (xInd, yInd );
15+ glm::ivec2 bufferInds = view::screenCoordsToBufferIndsVec (screenCoords);
16+ return queryPickAtBufferInds (bufferInds );
1717}
18- PickResult queryPickAtBufferCoords ( int xPos, int yPos ) {
18+ PickResult queryPickAtBufferInds (glm::ivec2 bufferInds ) {
1919 PickResult result;
2020
2121 // Query the render buffer
22- result.position = view::bufferCoordsToWorldPosition (xPos, yPos );
22+ result.position = view::bufferIndsToWorldPosition (bufferInds );
2323 result.depth = glm::length (result.position - view::getCameraWorldPosition ());
2424
2525 // Query the pick buffer
26- std::pair<Structure*, size_t > rawPickResult = pick::pickAtBufferCoords (xPos, yPos );
26+ std::pair<Structure*, size_t > rawPickResult = pick::pickAtBufferCoords (bufferInds. x , bufferInds. y );
2727
2828 // Transcribe result into return tuple
2929 result.structure = rawPickResult.first ;
30- result.bufferCoords = glm::ivec2 (xPos, yPos) ;
31- result.screenCoords = view::bufferIndsToScreenCoords (xPos, yPos );
30+ result.bufferCoords = bufferInds ;
31+ result.screenCoords = view::bufferIndsToScreenCoords (bufferInds );
3232 if (rawPickResult.first == nullptr ) {
3333 result.isHit = false ;
3434 result.structureType = " " ;
0 commit comments