cancel
Showing results for 
Search instead for 
Did you mean: 

handleDragEvent on specific object only

slawek
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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);
        }
...
}

View solution in original post

1 REPLY 1
Martin KJELDSEN
Chief III

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);
        }
...
}