Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added letter H in models directory #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions abckids/src/main/java/pk/farimarwat/abckids/models/LetterH.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

import android.graphics.Path
import android.graphics.RectF

class LetterH {
companion object {
fun getSegments(width: Int, height: Int): Path {
val path = Path()
val marginStart = (width * 0.2f) + 30.0f
val marginEnd = (width * 0.8f)
val marginTop = height * 0.1f
val marginBottom = height * 0.9f
val middleY = (marginTop + marginBottom) / 2

// Draw left vertical line
path.moveTo(marginStart, marginTop)
path.lineTo(marginStart, marginBottom)

// Draw horizontal line
path.moveTo(marginStart, middleY)
path.lineTo(marginEnd, middleY)

// Draw right vertical line
path.moveTo(marginEnd, marginTop)
path.lineTo(marginEnd, marginBottom)

return path
}
}
}