Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
95f044b0
Commit
95f044b0
authored
Mar 18, 2019
by
Piotr Gawron
Browse files
dashed line partially wasn't dashed in "Unknown Catalysis" and "Unknown Inhibition" reactions
parent
c7b5c331
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
95f044b0
...
...
@@ -28,6 +28,8 @@ minerva (12.3.0~alpha.0) unstable; urgency=low
(#
728
)
*
Bug
fix
:
when
editing
project
Disease
and
Organism
could
not
be
removed
(#
616
)
*
Bug
fix
:
dashed
line
partially
wasn
't dashed in "Unknown Catalysis" and
"Unknown Inhibition" reactions (#664)
minerva (12.2.0~beta.2) unstable; urgency=medium
* Bug fix: order of the overlays is defined explicitly also for general
...
...
converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/reaction/ReactionConverter.java
View file @
95f044b0
...
...
@@ -135,19 +135,26 @@ public class ReactionConverter extends BioEntityConverter<Reaction> {
* where the rectangle should be drawn
*/
protected
void
drawRectangleData
(
final
Line2D
line
,
final
ReactionRect
insideType
,
final
Graphics2D
graphics
)
{
Point2D
startPoint
=
line
.
getP1
();
Point2D
endPoint
=
line
.
getP2
();
double
pointX
=
(
startPoint
.
getX
()
+
endPoint
.
getX
())
/
2
;
double
pointY
=
(
startPoint
.
getY
()
+
endPoint
.
getY
())
/
2
;
Point2D
centerPoint
=
new
Point2D
.
Double
(
pointX
,
pointY
);
double
dx
=
endPoint
.
getX
()
-
startPoint
.
getX
();
double
dy
=
endPoint
.
getY
()
-
startPoint
.
getY
();
double
angle
=
Math
.
atan2
(
dy
,
dx
);
if
(
insideType
==
null
)
{
graphics
.
draw
(
line
);
Point2D
topPoint
=
new
Point2D
.
Double
(
pointX
+
RECT_SIZE
/
2
,
pointY
);
topPoint
=
new
PointTransformation
().
rotatePoint
(
topPoint
,
angle
,
centerPoint
);
Point2D
bottomPoint
=
new
Point2D
.
Double
(
pointX
-
RECT_SIZE
/
2
,
pointY
);
bottomPoint
=
new
PointTransformation
().
rotatePoint
(
bottomPoint
,
angle
,
centerPoint
);
graphics
.
draw
(
new
Line2D
.
Double
(
topPoint
,
bottomPoint
));
}
else
{
Point2D
startPoint
=
line
.
getP1
();
Point2D
endPoint
=
line
.
getP2
();
double
dx
=
endPoint
.
getX
()
-
startPoint
.
getX
();
double
dy
=
endPoint
.
getY
()
-
startPoint
.
getY
();
double
angle
=
Math
.
atan2
(
dy
,
dx
);
// find rectangle
Rectangle2D
rect
=
new
Rectangle2D
.
Double
();
double
pointX
=
(
startPoint
.
getX
()
+
endPoint
.
getX
())
/
2
;
double
pointY
=
(
startPoint
.
getY
()
+
endPoint
.
getY
())
/
2
;
rect
.
setRect
(
pointX
-
RECT_SIZE
/
2
,
pointY
-
RECT_SIZE
/
2
,
RECT_SIZE
,
RECT_SIZE
);
// rotate graphics by the angle defined by line (instead of rotating
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment