Bug 435507 - Element creation should support Snap To Grid
Summary: Element creation should support Snap To Grid
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0M6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.0.0   Edit
Assignee: Laurent Redor CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on: 437544
Blocks:
  Show dependency tree
 
Reported: 2014-05-22 07:32 EDT by Laurent Redor CLA
Modified: 2015-08-07 08:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Redor CLA 2014-05-22 07:32:34 EDT
If "Snap To Grid" property is enabled (in the "Rulers & Grid" tab of diagrams properties view), elements (node or edge) should be created on the grid.

Steps to reproduce:
* With Ecore tools 2 (for example), create a Class Diagram
* Enable the "Snap To Grid" property ("Ruler Units"=Pixels, "Grid Spacing"=100)
* Create a class on coordinates {125;125}
* The class is created on {125;125}, it should be created on {100;100}.

This enhancement will not be available for sequence diagrams because "Snap To Grid" is not supported for this kind of diagram (see documentation for more explanations).
Comment 1 Laurent Redor CLA 2014-05-26 05:34:50 EDT
Bug 435756 has been created: This bug has been discovered while creating use cases for this feature.
Comment 3 Laurent Redor CLA 2014-07-04 07:51:32 EDT
Several commits for this feature:
* Fix bug concerning creation in container [1]
* Depreciate disableSnapToGrid() method [2]
* Consider SnapTo during creation of node or edge [3]
* Update Spec - Add ref to bugzilla 437544 [4]
* Update Spec - Add details for edge case [5]
* Change parameter of GraphicalHelper.getZoom [6]
* Specific code for edge creation [7]
* Fix default GMF size computation for container [8]
* Fix border node location [9]
* Add utilities methods for tests [10]

[1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=86ac80548b994991f615e8cb59685024ac7970a4
[2] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a4b2d815269532639479a194f886291636af604a
[3] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=278bcefbf04a5e93636b16b45ccce27e455cc3be
[4] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7ab961f2e4ed58e30af295bfe03835b3fef22e5d
[5] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=becc81ad22b9da06c823dabdbebc680a78ee00bb
[6] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=5daeaff4dd98074efe267c43799c4448276c8119
[7] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=37c2805bc120501210fc0839ca31c9fa3ddab67a
[8] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4054e2998f3cd09f43e6612e33cd3fe129c66e8c
[9] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=475a05203d64876e1a17c7239fa07c5e12a1b657
[10] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6dc712ef69e6b59e05c9ef31566d87daf4c20774
Comment 4 Laurent Redor CLA 2014-07-04 10:53:56 EDT
Fixed on master branch
Comment 5 Pierre-Charles David CLA 2014-10-27 06:51:21 EDT
Available in Sirius 2.0.0.
Comment 6 Eclipse Genie CLA 2015-08-07 04:57:24 EDT
New Gerrit change created: https://git.eclipse.org/r/53381