Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java	(revision 23721)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java	(revision 23734)
@@ -161,26 +161,11 @@
 				int ele = (int) WayPointHelper.getElevation(wpt);
 
-				if (selWayPoint == null) {
-					if (lastWpt != null) {					
-						int h1 = WayPointHelper.getHourOfWayPoint(wpt);
-						int h2 = WayPointHelper.getHourOfWayPoint(lastWpt);
-						if (h1 != h2) { // hour changed?
-							renderer.renderWayPoint(g, profile, mv, wpt,
-									ElevationWayPointKind.FullHour);
-						} else { // check for elevation gain
-							if (ele > lastEle) {
-								renderer.renderWayPoint(g, profile, mv, wpt,
-										ElevationWayPointKind.ElevationGain);
-							} else {
-								renderer.renderWayPoint(g, profile, mv, wpt,
-										ElevationWayPointKind.ElevationLoss);
-							}
-						}
-					}
-				} else {
-					if (selWayPoint == wpt)  {
+				if (lastWpt != null) {					
+					int h1 = WayPointHelper.getHourOfWayPoint(wpt);
+					int h2 = WayPointHelper.getHourOfWayPoint(lastWpt);
+					if (h1 != h2) { // hour changed?
 						renderer.renderWayPoint(g, profile, mv, wpt,
-							ElevationWayPointKind.Highlighted);
-					} else {
+								ElevationWayPointKind.FullHour);
+					} else { // check for elevation gain
 						if (ele > lastEle) {
 							renderer.renderWayPoint(g, profile, mv, wpt,
@@ -193,5 +178,5 @@
 				}
 
-				// remember for next iteration
+				// remember some things for next iteration
 				lastEle = (int) WayPointHelper.getElevation(wpt);
 				lastWpt = wpt;
@@ -199,8 +184,16 @@
 			}
 
+			// paint selected way point, if available
+			if (selWayPoint != null) {
+				renderer.renderWayPoint(g, profile, mv, selWayPoint,
+						ElevationWayPointKind.Highlighted);
+			}
+
+			// paint start/end
 			renderer.renderWayPoint(g, profile, mv, profile.getStartWayPoint(),
 					ElevationWayPointKind.StartPoint);
 			renderer.renderWayPoint(g, profile, mv, profile.getEndWayPoint(),
 					ElevationWayPointKind.EndPoint);
+			// paint min/max
 			renderer.renderWayPoint(g, profile, mv, profile.getMaxWayPoint(),
 					ElevationWayPointKind.MaxElevation);
