Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
6fcf56cc
Commit
6fcf56cc
authored
13 years ago
by
Florian Hölzl
Browse files
Options
Downloads
Patches
Plain Diff
fixed ellipse border clamping
refs 352
parent
13695814
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/layout/EllipseCurveLayoutDiagramConfiguration.java
+11
-8
11 additions, 8 deletions
...ase/ui/layout/EllipseCurveLayoutDiagramConfiguration.java
with
11 additions
and
8 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/layout/EllipseCurveLayoutDiagramConfiguration.java
+
11
−
8
View file @
6fcf56cc
...
...
@@ -101,25 +101,28 @@ public class EllipseCurveLayoutDiagramConfiguration extends
ChangeBoundsRequest
request
,
StickyConnectorEditPartBase
<?
extends
ILayoutedModelElement
>
connectorEditPart
,
IFigure
connectorFigure
)
{
ILayoutedModelElement
stickyConnector
=
connectorEditPart
.
getModel
();
ILayoutedModelElement
stickyConnectorModel
=
connectorEditPart
.
getModel
();
double
angle
=
getConnectorAngleAsDouble
(
stickyConnectorModel
);
double
angle
=
getConnectorAngleAsDouble
(
stickyConnector
);
Dimension
stateSize
=
connectorEditPart
.
getFigure
().
getSize
();
Point
oldPosition
=
calculateEllipseBorderPoint
(
angle
,
stat
eSize
,
// compute old bounds
Dimension
ellipseSize
=
connectorEditPart
.
getParentEditPart
()
.
getFigure
().
getSize
();
Point
oldPosition
=
calculateEllipseBorderPoint
(
angle
,
ellips
eSize
,
HALF_DEFAULT_CONNECTOR_SIZE
).
translate
(
-
HALF_DEFAULT_CONNECTOR_SIZE
,
-
HALF_DEFAULT_CONNECTOR_SIZE
);
// apply movement delta
Point
newPosition
=
oldPosition
.
getTranslated
(
request
.
getMoveDelta
());
Dimension
ellipseSize
=
connectorEditPart
.
getParentEditPart
()
.
getFigure
().
getSize
();
// fix new position to ellipse border
newPosition
.
translate
(
ellipseSize
.
getScaled
(-.
5
));
newPosition
.
translate
(
HALF_DEFAULT_CONNECTOR_SIZE
,
HALF_DEFAULT_CONNECTOR_SIZE
);
// this converts from bounds to polar and back to ellipse border
// location
newPosition
=
calculateEllipseBorderPoint
(
new
Polar
(
newPosition
).
angle
,
ellipseSize
,
HALF_DEFAULT_CONNECTOR_SIZE
).
translate
(
-
HALF_DEFAULT_CONNECTOR_SIZE
,
-
HALF_DEFAULT_CONNECTOR_SIZE
);
// update move delta with new position
request
.
setMoveDelta
(
new
Point
().
translate
(
newPosition
.
getDifference
(
oldPosition
)));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment