Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 226103

Summary: findMouseEventTargetAt problem with local coordinate system
Product: [Tools] GEF Reporter: Manuel Selva <manuel.selva>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Main reproducing the bug none

Description Manuel Selva CLA 2008-04-08 05:38:28 EDT
Created attachment 95174 [details]
Main reproducing the bug

Build ID: I20080207-1530

Steps To Reproduce:
1. Launch the attached main
2. Click on the blue label
3. Noticed that the yellow rectangle is notified with a MousePressed event.


More information:
Comment 1 Manuel Selva CLA 2008-04-08 06:42:31 EDT
(In reply to comment #0)
> Created an attachment (id=95174) [details]
> Main reproducing the bug
> 
> Build ID: I20080207-1530
> 
> Steps To Reproduce:
> 1. Launch the attached main
> 2. Click on the blue label
> 3. Noticed that the yellow rectangle is notified with a MousePressed event.
> 
> 
> More information:

I forgot to fill the more info part :

After looking into draw2d's code it seems that the bug comes from:

Figure.findMouseEventTargetInDescendantsAt(int x, int y)

In this "recursive" method a static field PRIVATE_POINT is used. In the attached sample this PRIVATE_POINT is modified by the first call to this method on the orange rectangle and then this modified PRIVATE_POINT is used on the second call on the red rectangle returning the yellow rectangle.

We can may be fix this by adding an else statement in the method to restore the PRIVATE_POINT as following :

fig = fig.findMouseEventTargetAt(PRIVATE_POINT.x, PRIVATE_POINT.y);
if (fig != null) 
   return fig;
else {
   PRIVATE_POINT.setLocation(x, y);
   translateFromParent(PRIVATE_POINT);
}

 

Comment 2 Manuel Selva CLA 2009-06-19 08:38:19 EDT
Not reproduced with last Draw2d version. Don't understand why since Figure class didn't change. 

Anyway I am closing this bug.

Manu