Skip to content
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

Eliminate code duplication #5

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f44c9cc
Follow suggestion "Type may be primitive"
kolesar-andras Jan 28, 2023
8920c0b
Fix warning "integer division in floating-point context"
kolesar-andras Jan 28, 2023
33c9775
Extend class from core
kolesar-andras Jan 28, 2023
2eb39d7
Rename class to match plugin name
kolesar-andras Jan 28, 2023
1666259
Remove unused code
kolesar-andras Jan 28, 2023
de55362
Switch to LF line endings
kolesar-andras Jan 28, 2023
19fed78
Move static methods to helper class
kolesar-andras Jan 28, 2023
689981e
Simplify code from parent class
kolesar-andras Jan 28, 2023
d42e277
Fix registration in keydetector
kolesar-andras Jan 28, 2023
f5b78d0
Reuse whole paint method from parent class
kolesar-andras Jan 29, 2023
e369ec4
Extract methods from paint
kolesar-andras Jan 29, 2023
971d37c
Move local variable declaration into smallest possible scope
kolesar-andras Jan 29, 2023
cd95baa
Remove unused code
kolesar-andras Jan 29, 2023
4086a14
Rename mod4 to meta
kolesar-andras Jan 29, 2023
b10071c
Fix bug when paint did not follow mouse movement
kolesar-andras Jan 29, 2023
992278d
Switch from EastNorth to LatLon
kolesar-andras Jan 29, 2023
a47dc15
Remove override of mouseReleased method
kolesar-andras Jan 29, 2023
857b642
Fix old bug that caused NPE
kolesar-andras Jan 29, 2023
a58d8ba
Skip updating cursor dependent object while meta key is pressed
kolesar-andras Jan 29, 2023
ca2d799
Use the same condition in related methods
kolesar-andras Jan 29, 2023
b5e8442
Use own copy of base class until merge
kolesar-andras Jan 30, 2023
7040438
Move settings management to a new class
kolesar-andras Jan 30, 2023
35d63b8
Test revert and resolve conflict with later commit
kolesar-andras Jan 30, 2023
97a9883
Add copy of base class from core
kolesar-andras Jan 30, 2023
bd4a8c2
Don't use wildcard imports
kolesar-andras Feb 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Follow suggestion "Type may be primitive"
  • Loading branch information
kolesar-andras committed Jan 28, 2023
commit f44c9ccc7c98efb76fabe1e3fdf69e03c2c35a67
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public static Node findCandidateNode(MapView mv, Way w, Point p) {

EastNorth pEN = mv.getEastNorth(p.x, p.y);

Double bestDistance = Double.MAX_VALUE;
Double currentDistance;
double bestDistance = Double.MAX_VALUE;
double currentDistance;
List<Pair<Node, Node>> wpps = w.getNodePairs(false);

Node result = null;
Expand Down Expand Up @@ -132,10 +132,10 @@ public static IWaySegment<Node, Way> findCandidateSegment(MapView mv, Way w, Poi

EastNorth pEN = mv.getEastNorth(p.x, p.y);

Double currentDistance;
Double currentAngle;
Double bestDistance = Double.MAX_VALUE;
Double bestAngle = 0.0;
double currentDistance;
double currentAngle;
double bestDistance = Double.MAX_VALUE;
double bestAngle = 0.0;

int candidate = -1;

Expand Down