Bug 507617 - Can't use "Straighten" actions on non-rectangular shapes
Summary: Can't use "Straighten" actions on non-rectangular shapes
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 4.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-11-16 09:47 EST by Cedric Brun CLA
Modified: 2016-11-16 10:08 EST (History)
2 users (show)

See Also:


Attachments
screenshot when right clicking on the edge (68.51 KB, image/png)
2016-11-16 09:47 EST, Cedric Brun CLA
no flags Details
projects to reproduce the situation (202.53 KB, application/zip)
2016-11-16 09:48 EST, Cedric Brun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2016-11-16 09:47:52 EST
Created attachment 265382 [details]
screenshot when right clicking on the edge

Steps to reproduce.
- install the family metamodel
- import the attached projects into your workspace
- open "basicfamily.sample"
- open the diagram "straighten"
- right-click on the edge in between "Léa" and "Paul"
=> the straighten actions are all disabled though should be enabled

the routing style is "oblique", I can't find any reason (beside a bug) explaining why those actions are disabled.
Comment 1 Cedric Brun CLA 2016-11-16 09:48:32 EST
Created attachment 265383 [details]
projects to reproduce the situation
Comment 2 Pierre-Charles David CLA 2016-11-16 10:06:41 EST
Confirmed. After some debugging, this is caused to the use of non-rectangular shapes; the code which is used to decide if the command is executable tests if the source and target of the edge are on "compatible" sides, and in org.eclipse.sirius.diagram.ui.internal.edit.commands.StraightenToCommand.getLocation(Point, Rectangle) which determines the side, we assume the edge's endpoints are exactly on the bounding-box. If they are not *exactly* on the side, the location computation is wrong, and canExecute() will eventually return false.