From 4af103fb02d51df05702e81f163d9a7cae3ec110 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 8 Dec 2014 12:56:05 -0500 Subject: [PATCH] When setting a new primary or secondary turn, clear the bits from the currently-set turn first. --- OsmAnd-java/src/net/osmand/router/TurnType.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/router/TurnType.java b/OsmAnd-java/src/net/osmand/router/TurnType.java index 8884c64ede..00e973da6d 100644 --- a/OsmAnd-java/src/net/osmand/router/TurnType.java +++ b/OsmAnd-java/src/net/osmand/router/TurnType.java @@ -162,12 +162,13 @@ public class TurnType { this.lanes = lanes; } - // Note that there is no "weight" or ordering between the primary and secondary turns. + // Note that the primary turn will be the one displayed on the map. public static void setPrimaryTurn(int[] lanes, int lane, int turnType) { lanes[lane] |= (turnType << 1); } public void setPrimaryTurn(int lane, int turnType) { + lanes[lane] &= ~(15 << 1); lanes[lane] |= (turnType << 1); } @@ -177,6 +178,7 @@ public class TurnType { } public static void setSecondaryTurn(int[] lanes, int lane, int turnType) { + lanes[lane] &= ~(15 << 5); lanes[lane] |= (turnType << 5); }