常用方法:View

2019-06-18  本文已影响0人  别却江南
fun View.pointInView(points: FloatArray): Boolean {
    points[0] = points[0] - this.left
    points[1] = points[1] - this.top
    val matrix = this.matrix
    if (!matrix.isIdentity) {
        matrix.invert(matrix)
        matrix.mapPoints(points)
    }
    return points[0] >= 0 && points[1] >= 0 && points[0] < this.width && points[1] < this.height
}
上一篇 下一篇

猜你喜欢

热点阅读