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

Update Helper.kt #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

TanotiCoder
Copy link

Hello Sir,

I hope this message finds you well. I wanted to reach out and express my gratitude for your incredible repository on GitHub. I have been actively learning from it, and I must say that it has been an enriching experience.

During my learning journey, I came across a specific section of code in your repository that caught my attention. The following lines of code:

val midPoint = calculateMidpoint(it, point)
if (i == 1) {
    this.lineTo(midPoint.x, midPoint.y)
} else {
    this.quadraticBezierTo(it.x, it.y, midPoint.x, midPoint.y)
}

And the accompanying function:

private fun calculateMidpoint(start: Offset, end: Offset) =
    Offset((start.x + end.x) / 2, (start.y + end.y) / 2)

Upon careful consideration and analysis, I believe that this section of code can be optimized by replacing it with:

this.lineTo(it.x, it.y)

This change simplifies the code while achieving the same functionality. I have tested it, and I am pleased to inform you that it works perfectly.

I am thrilled to contribute this improvement to your repository. If you find it valuable and beneficial, I kindly request you to consider merging this change into the main codebase. I believe it will enhance the code readability and maintainability.

I would like to express my gratitude for your dedication to sharing your expertise with the community. Your repository has provided me with valuable knowledge and has also inspired me to actively contribute to open-source projects.

I am excited to inform you that this is my first contribution on GitHub. It is an honor to make a meaningful contribution to a project that has played a significant role in my learning journey.

Once again, thank you for your remarkable work and for fostering a community of learning and collaboration. I look forward to your feedback and the opportunity to contribute further to your repository in the future.

Best regards,
Sai Prasad Dubey

Replace the toLine from condition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant