Bug 520629 - Snap to grid constraint is not taken into account after D&D from model explorer.
Summary: Snap to grid constraint is not taken into account after D&D from model explorer.
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.0.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 5.1.0   Edit
Assignee: Florian Barbin CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-08-07 10:43 EDT by Jessy Mallet CLA
Modified: 2017-11-08 03:37 EST (History)
3 users (show)

See Also:


Attachments
Test case to use. (7.70 KB, application/x-zip-compressed)
2017-08-07 10:43 EDT, Jessy Mallet CLA
no flags Details
ScreenShot of the Drag and drop behaviour (90.79 KB, image/png)
2017-08-07 10:47 EDT, Jessy Mallet CLA
no flags Details
Properties of the grid (11.46 KB, image/png)
2017-08-08 04:06 EDT, Jessy Mallet CLA
no flags Details
new issue use case (3.33 KB, application/zip)
2017-09-20 09:50 EDT, Florian Barbin CLA
no flags Details
new issue use case (3.42 KB, application/zip)
2017-09-20 10:08 EDT, Florian Barbin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jessy Mallet CLA 2017-08-07 10:43:06 EDT
Created attachment 269714 [details]
Test case to use.

On diagram with "Snap to grid" activated, when user drag and drop an element from model explorer on the diagram, tne new border node appears but it does not respect "Snap to grid" constraints and it is not aligned with the grid anymore.
Drag and drop action should take into account "Snap to grid" constraints.


Step to reproduce :
* import in your workspace the modeling project DragAndDropBorderNode.zip,
* open representation "new packageDiag",
* make sure that "Snap to Grid" box is marked in properties view of diagram (tab Rulers&Grid) 
* select "C5" class in P2 package from model explorer and drag and drop on P3 package on diagram
* border Node appears on P3 package but it is not snap on grid anymore -> KO
  It should be align on the grid.
Comment 1 Jessy Mallet CLA 2017-08-07 10:47:22 EDT
Created attachment 269715 [details]
ScreenShot of the Drag and drop behaviour
Comment 2 Jessy Mallet CLA 2017-08-08 04:06:54 EDT
Created attachment 269728 [details]
Properties of the grid
Comment 3 Florian Barbin CLA 2017-08-09 03:40:21 EDT
Issue accepted and marked as triaged.
Comment 6 Laurent Redor CLA 2017-09-01 10:21:58 EDT
Some tests of org.eclipse.sirius.tests.swtbot.DragAndDropWithSnapToGridTest are always KO even with the above fix. It reveals this problem:

Steps to reproduce:
* Import project DesignerTestProject from DnDProject.zip
* Open diagram new TC1041 representation 2 Blank
* Activate the snap to grid with a grid step of 25 pixels (for example)
* Move P2 on the diagram
* KO, the new container is not snap to the grid

This problem will be probably another issue as it is not a drag'n'drop from ModelExplorer.
Comment 7 Laurent Redor CLA 2017-09-04 04:23:25 EDT
A specific issue, bug 521802, has been created for the above problem.
Comment 8 Eclipse Genie CLA 2017-09-05 03:15:14 EDT
New Gerrit change created: https://git.eclipse.org/r/104312
Comment 10 Eclipse Genie CLA 2017-09-08 05:57:22 EDT
New Gerrit change created: https://git.eclipse.org/r/104726
Comment 12 Eclipse Genie CLA 2017-09-20 09:46:57 EDT
New Gerrit change created: https://git.eclipse.org/r/105506
Comment 13 Florian Barbin CLA 2017-09-20 09:49:41 EDT
Additional Steps to reproduce

There is an issue with zoom 175% for instance:

Import the new use case
Open "new TC1041 representation 2 Blank"
Activate the snap to grid (50px for instance)
Set the zoom at 175%
Drag and drop P1
KO : P1 is not snap on the grid.
Comment 14 Florian Barbin CLA 2017-09-20 09:50:42 EDT
Created attachment 270274 [details]
new issue use case
Comment 15 Florian Barbin CLA 2017-09-20 10:08:07 EDT
Created attachment 270276 [details]
new issue use case
Comment 17 Jessy Mallet CLA 2017-09-25 04:50:58 EDT
Validated on Sirius Stable 5.1.0.201709221508
Comment 18 Pierre-Charles David CLA 2017-11-08 03:37:03 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.