Skip to content

Commit

Permalink
Properly stack scene updates (fix #4901)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Mar 27, 2023
1 parent 400ac66 commit 1be2db4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SceneMapComponent(
private val ctrl: KtMapController,
private val vectorTileProvider: VectorTileProvider
) {
private var sceneUpdates: MutableSet<List<Pair<String, String>>> = mutableSetOf()
private var sceneUpdates: MutableList<List<Pair<String, String>>> = mutableListOf()

private var loadedSceneFilePath: String? = null
private var loadedSceneUpdates: List<String>? = null
Expand All @@ -41,7 +41,8 @@ class SceneMapComponent(

/** Remove the given scene updates */
fun removeSceneUpdates(updates: List<Pair<String, String>>) {
sceneUpdates.remove(updates)
val idx = sceneUpdates.indexOfLast { updates == it }
if (idx != -1) sceneUpdates.removeAt(idx)
}

/** (Re)load the scene.
Expand Down

0 comments on commit 1be2db4

Please sign in to comment.