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

Bug 496620

Summary: Within the Logo example, shapes are falsely offset when dragged and snap-to-grid is enabled.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0.0   
Target Milestone: 5.0.0 (Oxygen) M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Initial position of a handle shape.
none
Shape position after first "drag".
none
Shape position after second "drag". none

Description Matthias Wienand CLA 2016-06-23 04:54:11 EDT
Created attachment 262619 [details]
Initial position of a handle shape.

Within the MVC Logo example, shapes are falsely offset when dragged and snap-to-grid is enabled.
Comment 1 Matthias Wienand CLA 2016-06-23 04:55:04 EDT
Created attachment 262620 [details]
Shape position after first "drag".
Comment 2 Matthias Wienand CLA 2016-06-23 04:55:26 EDT
Created attachment 262621 [details]
Shape position after second "drag".
Comment 3 Matthias Wienand CLA 2016-09-14 07:19:29 EDT
I refactored and simplified the snap-to-grid computation and ensured that the shapes are moved only to grid positions while dragging. However, in other snap-to-grid interactions (e.g. resize via handles) the mouse position is snapped to grid positions, but not the model position, therefore, the code still needs adjustments in these cases.
Comment 4 Matthias Wienand CLA 2016-09-21 09:06:05 EDT
Pushed the following changes to origin/master:
 - Fix snap-to-grid for bending connections.
 - Fix nearest snap-to-grid for negative coordinates.
 - Extract snap functionality into SnapSupport class.

As a result, snapping is now implemented for all mouse drag interactions provided within MVC.FX. Therefore, I resolve this ticket as fixed for 5.0.0 M3.