Моя текущая форма
мой код для ее рисования
Код: Выделить всё
fun Path.customHexagon(radius: Float, size: Size) {
val triangleHeight = (sqrt(3.0) * radius / 2)
val centerX = size.width / 2
val centerY = size.height / 2
moveTo(centerX, centerY + radius)
lineTo((centerX - triangleHeight).toFloat(), centerY + radius/2)
lineTo((centerX - triangleHeight).toFloat(), centerY - radius/2)
lineTo(centerX, centerY - radius)
lineTo((centerX + triangleHeight).toFloat(), centerY - radius/2)
lineTo((centerX + triangleHeight).toFloat(), centerY + radius/2)
close()
}
Помогите с кодом или дайте ссылку на библиотеку с фигурами Android
Подробнее здесь: https://stackoverflow.com/questions/787 ... on-android
Мобильная версия