Skip to content
Snippets Groups Projects
Commit 6e8b1c1b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

center line wasn't drawn in the right color

parent de005127
No related branches found
No related tags found
1 merge request!897Resolve "boolean reaction colouring not working"
Pipeline #13037 canceled
...@@ -909,10 +909,10 @@ public class ReactionFromXml { ...@@ -909,10 +909,10 @@ public class ReactionFromXml {
PolylineData line = new PolylineData(); PolylineData line = new PolylineData();
line.addPoint(pointTransformation.copyPoint(product.getLine().getBeginPoint())); line.addPoint(pointTransformation.copyPoint(product.getLine().getBeginPoint()));
Point2D secondPoint = pointTransformation.getPointOnLine(product.getLine().getPoints().get(1), Point2D secondPoint = pointTransformation.getPointOnLine(product.getLine().getPoints().get(0),
product.getLine().getPoints().get(0), 0.4); product.getLine().getPoints().get(1), 0.4);
Point2D thirdPoint = pointTransformation.getPointOnLine(product.getLine().getPoints().get(1), Point2D thirdPoint = pointTransformation.getPointOnLine(product.getLine().getPoints().get(0),
product.getLine().getPoints().get(0), 0.6); product.getLine().getPoints().get(1), 0.6);
line.addPoint(pointTransformation.copyPoint(secondPoint)); line.addPoint(pointTransformation.copyPoint(secondPoint));
operator.setLine(line); operator.setLine(line);
......
...@@ -127,11 +127,11 @@ public class ReactionConverter extends BioEntityConverter<Reaction> { ...@@ -127,11 +127,11 @@ public class ReactionConverter extends BioEntityConverter<Reaction> {
0.5 - RECT_SIZE / (2 * startPoint.distance(endPoint))); 0.5 - RECT_SIZE / (2 * startPoint.distance(endPoint)));
Point2D rectEndPoint = pointTransformation.getPointOnLine(startPoint, endPoint, Point2D rectEndPoint = pointTransformation.getPointOnLine(startPoint, endPoint,
0.5 + RECT_SIZE / (2 * startPoint.distance(endPoint))); 0.5 + RECT_SIZE / (2 * startPoint.distance(endPoint)));
PolylineData preRectangleLine = new PolylineData(); PolylineData preRectangleLine = line.getSubline(0, 0);
preRectangleLine.addPoint(startPoint); preRectangleLine.addPoint(startPoint);
preRectangleLine.addPoint(rectStartPoint); preRectangleLine.addPoint(rectStartPoint);
PolylineData postRectangleLine = new PolylineData(); PolylineData postRectangleLine = line.getSubline(0, 0);
postRectangleLine.addPoint(rectEndPoint); postRectangleLine.addPoint(rectEndPoint);
postRectangleLine.addPoint(endPoint); postRectangleLine.addPoint(endPoint);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment