bastienFalcou / SoundWave

Illustrate your sound waves on the fly 🚀
MIT License
596 stars 93 forks source link

How can I remove white lines in the middle of a level meter? #40

Closed HanSJin closed 4 years ago

HanSJin commented 5 years ago

Hi. @bastienFalcou I have a question :) .. How can I remove white lines in the middle of a level meter? The sample what I want as follows.

스크린샷 2019-06-11 오후 9 46 21

Thank you for your answer 👍

bastienFalcou commented 5 years ago

Hi @HanSJin! Unfortunately this is not something we currently support, although it can be added in a future Pull Request as part of the customization. I can try to address that in the coming days! Otherwise feel free to open a Pull Request if you get there earlier 😊

HanSJin commented 5 years ago

Thank you for your answer 🙂 I found that the cornerRadius was applied both up and down in the UpperBar/LowerBar. So, what I'm curious about is, is there a reason why you split the level meter into upper/lower bars?

HanSJin commented 5 years ago
barPath = UIBezierPath(roundedRect: CGRect(x: xPointForMeteringLevel,
                                           y: self.centerY - heightForMeteringLevel,
                                           width: self.meteringLevelBarWidth,
                                            height: heightForMeteringLevel * 2),
                       cornerRadius: self.meteringLevelBarCornerRadius)

Likes above codes, If the distinguish of upper/lower division is removed and the bar is drawn with one BezierPath, the middle division line disappears. If there is no special issue with the division line, I will create a PR that can adjust it to be an option.

bastienFalcou commented 5 years ago

Hi @HanSJin, my apologies for the delay answering!

The reason for this splitting in two upper/lower bars was purely due to design directions I initially had to follow for a project. We can totally inject an option that gives the choice to the user.

I saw that you opened a Pull Request, fantastic I am going to review it. Thank you so much for your contribution! 💪