Commit 059ab2f2 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

anchor point is computed based on new data model

parent 698356fd
......@@ -163,7 +163,7 @@ public class ModifierTypeUtils {
* reaction on which target line index is looked for
* @param originalLine
* line that connects modifier to the reaction
* @return string that identfies TargetLine index for modifier line
* @return string that identifies TargetLine index for modifier line
*/
private String getTragteLineIndex(ModifierType modType, Reaction reaction, PolylineData originalLine) {
PolylineData line = new PolylineData(originalLine);
......@@ -189,13 +189,14 @@ public class ModifierTypeUtils {
* lineConnectionType associated with the modification.
*
* @param reaction
* rection on which we are looking for a point
* reaction on which we are looking for a point
* @param lineConnectionType
* point of connection to the reaction center rectangle
* @return coordinates of point on the center rectangle
*/
public Point2D getAnchorPointOnReactionRect(Reaction reaction, String lineConnectionType) {
Line2D centerLine = reaction.getCenterLine();
int countLines = reaction.getLine().getPoints().size()-1;
Line2D centerLine = reaction.getLine().getLines().get(countLines/2);
double dx = centerLine.getX2() - centerLine.getX1();
double dy = centerLine.getY2() - centerLine.getY1();
double angle = Math.atan2(dy, dx);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment