Skip to content

Commit

Permalink
Add terrain double tap support in Android version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ComBatVision committed Sep 29, 2024
1 parent c19b77d commit d9fc681
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ open class SelectDragDetector(protected val wwd: WorldWindow) : SimpleOnGestureL
val callback = callback ?: return false
return runBlocking {
val (renderable, position) = awaitPickResult(false)
if (renderable is Renderable && position != null) {
callback.onRenderableDoubleTap(renderable, position)
if (position != null) {
if (renderable is Renderable) callback.onRenderableDoubleTap(renderable, position)
else callback.onTerrainDoubleTap(position)
wwd.requestRedraw()
true
} else false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,11 @@ interface SelectDragCallback {
* @param position picked terrain or renderable center position
*/
fun onRenderableDoubleTap(renderable: Renderable, position: Position) {}

/**
* Terrain position was double-tapped or double-clicked
*
* @param position picked terrain position
*/
fun onTerrainDoubleTap(position: Position) {}
}

0 comments on commit d9fc681

Please sign in to comment.