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

commonMain.org.jetbrains.skia.paragraph.PositionWithAffinity.kt Maven / Gradle / Ivy

There is a newer version: 0.8.15
Show newest version
package org.jetbrains.skia.paragraph

class PositionWithAffinity(val position: Int, affinity: Affinity) {
    val _affinity: Affinity
    val affinity: Affinity
        get() = _affinity

    override fun equals(other: Any?): Boolean {
        if (other === this) return true
        if (other !is PositionWithAffinity) return false
        if (position != other.position) return false
        return this.affinity == other.affinity
    }

    override fun hashCode(): Int {
        val PRIME = 59
        var result = 1
        result = result * PRIME + position
        result = result * PRIME + affinity.hashCode()
        return result
    }

    override fun toString(): String {
        return "PositionWithAffinity(_position=$position, _affinity=$affinity)"
    }

    init {
        _affinity = affinity
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy