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
Implemented Arrows (#864) #872
Conversation
Hmm weird... it seems, that we have another flaky test out here:
|
* @param yOffset The vertical pixel-difference between the frame and the Map | ||
* @param scale The scale-factor of the Map | ||
*/ | ||
private void drawArrow(Graphics2D graphics, Point2D from, Point2D to, int xOffset, int yOffset, double scale) { |
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.
you're not hitting any local state, looks like you can mark these private methods as static (note, static on private methods is a good thing since it makes the method easier to understand, provided you do not modify any static state. Static on public methods is bad, creates static coupling that hurts cohesion and makes testing difficult)
Some good stuff, but a few things can be improved |
@DanVanAtta done |
final Polygon arrowPolygon = new Polygon(); | ||
// 1- (-3) = arrowLength |
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.
Extract the one to a constant, then you can calculate the -3 value.
Idea is to capture any relationships between lines of code that are known to exist, so everything that needs to change, changes when you change the one thing.
@DanVanAtta done |
This adresses #864 and fixes some scaling issues (The Route was slightly offset when scaling to extreme values 15% etc.)
Screenshots:
This change is