Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 519305 - A bug in GMF NodeFigure sometimes causes snapToGrid problem
Summary: A bug in GMF NodeFigure sometimes causes snapToGrid problem
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 0.9   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 5.1.0   Edit
Assignee: Laurent Redor CLA
QA Contact: Julien Dupont CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 520408 520409
  Show dependency tree
 
Reported: 2017-07-06 08:25 EDT by Laurent Redor CLA
Modified: 2017-11-08 03:37 EST (History)
1 user (show)

See Also:


Attachments
EdgeCreationPositionTest.zip (10.63 KB, application/x-zip-compressed)
2017-07-06 08:25 EDT, Laurent Redor CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Redor CLA 2017-07-06 08:25:49 EDT
Created attachment 269248 [details]
EdgeCreationPositionTest.zip

When an edge is created with the snapToGrid enabled, it is sometimes not snaped to the grid. This is caused by a bug in NodeFigure where the getBounds() method is used to create the anchor and after, the getHandleBounds() is used to compute the corresponding location. The both methods do not return the same Rectangle. This explains the small shift that can be observed.

Steps to reproduce:
* Import the project "EdgeCreationPositionTest" (from "EdgeCreationPositionTest.zip")
* Open the diagram "Container"
* Activate the snapToGrid ("Ruler Units"=Pixels, and "Grid Spacing"=100)
* Activate the "Show Grid" option
* Enable the preference "Enable user specific default values" in Preferences/Sirius/Sirius Diagram/Connections" and set "Line style" to Rectilinear.
* Create an edge with the tool "Super" between "A" and "B" near the top grid line (y = 100).
* The edge is just above the grid line: KO it should be on the grid line.
Comment 2 Eclipse Genie CLA 2017-07-11 09:42:43 EDT
New Gerrit change created: https://git.eclipse.org/r/101056
Comment 4 Pierre-Charles David CLA 2017-11-08 03:37:05 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.