Skip to main content
slawek
Associate III
March 24, 2020
Solved

handleDragEvent on specific object only

  • March 24, 2020
  • 1 reply
  • 823 views

Is there a possibility to handle events which are in specific area, i.e. I would like to know when and how user drags over texture mapper area to rotate it accordingly.

Thank You,

Sławek

This topic has been closed for replies.
Best answer by Martin KJELDSEN

You can override the handleDragEvent function for your view and check if the coordinates intersect with various elements on screen. Here's some pseudocode

void MyView::handleDragEvent(const DragEvent& evt)
{
 
 int16_t newX = evt.getNewX();
 int16_t newY = evt.getNewY();
 
 //Check for intersection
 if(intersects)
 {
 element.handleDragEvent(evt);
 }
...
}

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
March 31, 2020

You can override the handleDragEvent function for your view and check if the coordinates intersect with various elements on screen. Here's some pseudocode

void MyView::handleDragEvent(const DragEvent& evt)
{
 
 int16_t newX = evt.getNewX();
 int16_t newY = evt.getNewY();
 
 //Check for intersection
 if(intersects)
 {
 element.handleDragEvent(evt);
 }
...
}