Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
mbe-tools
TTool
Commits
e677d81c
Commit
e677d81c
authored
4 months ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Solving ticket 416: overlay between connection between blocks in certain cases had been removed
parent
cfdb1b7a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/ui/AvatarPanelDrawer.java
+2
-2
2 additions, 2 deletions
src/main/java/ui/AvatarPanelDrawer.java
src/main/java/ui/TGComponent.java
+47
-0
47 additions, 0 deletions
src/main/java/ui/TGComponent.java
with
49 additions
and
2 deletions
src/main/java/ui/AvatarPanelDrawer.java
+
2
−
2
View file @
e677d81c
...
...
@@ -249,9 +249,9 @@ public class AvatarPanelDrawer {
}
if
(
p1
==
null
)
p1
=
b1
.
closerFreeTGConnectingPoint
(
b2
.
getX
(),
b2
.
getY
(),
false
,
true
);
p1
=
b1
.
closerFreeTGConnectingPoint
NoOverlay
(
b2
.
getX
(),
b2
.
getY
(),
false
,
true
);
if
(
p2
==
null
)
p2
=
b2
.
closerFreeTGConnectingPoint
(
b1
.
getX
(),
b1
.
getY
(),
true
,
false
);
p2
=
b2
.
closerFreeTGConnectingPoint
NoOverlay
(
b1
.
getX
(),
b1
.
getY
(),
true
,
false
);
if
(
p1
!=
null
&&
p2
!=
null
)
{
p1
.
setFree
(
false
);
p2
.
setFree
(
false
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/ui/TGComponent.java
+
47
−
0
View file @
e677d81c
...
...
@@ -2383,6 +2383,53 @@ public abstract class TGComponent extends AbstractCDElement implements /*CDEleme
return
currentCloser
;
}
public
TGConnectingPoint
closerFreeTGConnectingPointNoOverlay
(
int
x
,
int
y
,
boolean
mustBeIn
,
boolean
mustBeOut
)
{
TGConnectingPoint
currentCloser
=
null
;
TGConnectingPoint
currentp
;
double
d1
,
d2
;
int
i
;
int
ref
=
0
;
//compare current closer to my points.
for
(
i
=
0
;
i
<
nbConnectingPoint
;
i
++)
{
if
(
connectingPoint
[
i
]
instanceof
TGConnectingPointComment
)
{
continue
;
}
currentp
=
connectingPoint
[
i
];
if
((
currentp
!=
null
)
&&
(
currentp
.
isFree
())
&&
(
(
currentp
.
isIn
()
&&
mustBeIn
)
||
(
currentp
.
isOut
()
&&
mustBeOut
)))
{
// Check overlay
if
(!(
hasOverlayWhichIsNonFree
(
currentp
)))
{
if
(
currentCloser
==
null
)
{
currentCloser
=
currentp
;
ref
=
i
;
}
else
{
d1
=
Point2D
.
distanceSq
(
currentp
.
getX
(),
currentp
.
getY
(),
x
,
y
);
d2
=
Point2D
.
distanceSq
(
currentCloser
.
getX
(),
currentCloser
.
getY
(),
x
,
y
);
if
(
d1
<
d2
)
{
currentCloser
=
currentp
;
ref
=
i
;
}
}
}
}
}
if
(
currentCloser
!=
null
)
{
connectingPoint
[
ref
].
setFree
(
false
);
return
connectingPoint
[
ref
];
}
return
currentCloser
;
}
public
boolean
hasOverlayWhichIsNonFree
(
TGConnectingPoint
p
)
{
for
(
int
i
=
0
;
i
<
nbConnectingPoint
;
i
++)
{
TGConnectingPoint
pCurrent
=
connectingPoint
[
i
];
if
((
pCurrent
!=
p
)
&&
(!
pCurrent
.
isFree
())
&&
(
p
.
getX
()
==
pCurrent
.
getX
())
&&
(
p
.
getY
()
==
pCurrent
.
getY
()))
{
return
true
;
}
}
return
false
;
}
public
TGConnectingPoint
closerFreeTGConnectingPointCompatibility
(
int
x
,
int
y
,
boolean
out
,
boolean
in
,
int
compatibility
)
{
TGConnectingPoint
currentCloser
=
null
;
TGConnectingPoint
currentp
;
...
...
This diff is collapsed.
Click to expand it.
Ludovic Apvrille
@ludovic.apvrille
mentioned in issue
#416 (closed)
·
4 months ago
mentioned in issue
#416 (closed)
mentioned in issue #416
Toggle commit list
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