All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.aay.compose.utils.ClickedOnThisPoint.kt Maven / Gradle / Ivy

The newest version!
package com.aay.compose.utils

import kotlin.math.hypot

internal fun clickedOnThisPoint(
    clickedPoints: MutableList>,
    x: Float,
    y: Double,
    tolerance: Float,
) = clickedPoints.any {
    val xDiff = it.first - x
    val yDiff = it.second - y
    val distance = hypot(xDiff.toDouble(), yDiff)
    distance <= tolerance
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy