-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Up to N FeederInfos #341
Up to N FeederInfos #341
Conversation
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
…IntraMargin parameter Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
// If not enough space to have layoutParameters.getArrowDistance() at both sides of the 2 feeder infos, | ||
// we compute the distance between feeder anchor and first feeder info so that the two feeder infos are centered. | ||
double distFeederAnchorToFirstFeederInfoCenter = | ||
distancePoints >= 2 * layoutParameters.getFeederInfosOuterMargin() + 2 * componentSize.getHeight() | ||
? layoutParameters.getFeederInfosOuterMargin() | ||
: (distancePoints - 2 * componentSize.getHeight()) / 2; | ||
double x = pointA.getX() + cosAngle * (distFeederAnchorToFirstArrowCenter + shift); | ||
double y = pointA.getY() + sinAngle * (distFeederAnchorToFirstArrowCenter + shift); | ||
double x = pointA.getX() + cosAngle * (distFeederAnchorToFirstFeederInfoCenter + shift); | ||
double y = pointA.getY() + sinAngle * (distFeederAnchorToFirstFeederInfoCenter + shift); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete this code? I think there's no use to keep it now that the user is responsible for giving enough space for the feederInfos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed as following :
double distFeederAnchorToFirstFeederInfoCenter = layoutParameters.getFeederInfosOuterMargin()
@@ -851,15 +851,15 @@ protected void insertFeederInfos(String prefixId, | |||
points.add(new Point(feederNode.getDiagramCoordinates())); | |||
} | |||
|
|||
int iArrow = 0; | |||
double shiftFeederInfo2 = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake !
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
Kudos, SonarCloud Quality Gate passed! |
* Adding feederInfosIntraMargin parameter in LayoutParameters * Rename feederArrowSymmetry to feederInfoSymmetry in LayoutParameters * Rename arrowDistance to feederInfosOuterMargin in LayoutParameters * Rename minSpaceForFeederArrow to spaceForFeederInfos in LayoutParameters * Rename Arrow to FeederInfo in DefaultSVGWriter * Rename Arrow to FeederInfo in LayoutParameters * Add new test with 5 feeder info Signed-off-by: Thomas ADAM <tadam@silicom.fr> Signed-off-by: Marin Pinchinat-Loth <marin.pinchinat@rte-france.com>
Signed-off-by: Thomas ADAM tadam@silicom.fr
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restFixes #303
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the current behavior? (You can also link to an open issue here)
Only 2 FeederInfos expected
What is the new behavior (if this is a feature change)?
Add more that 2 FeederInfos
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)