UIBezierPath changes the width of the path segment

I am trying to develop a drawing application and I need to change the width of the path according to the speed of the hand.

I tried to use moveToPoint to start another subdirectory

myPath.moveToPoint(myPath.currentPoint)
myPath.lineWidth = myPath.lineWidth + 1

      

but it doesn't work, it changes the width of the whole path.

Do you know if there is a way to change only the width of the subpath?

+3


source to share


1 answer


It's impossible. All of the properties UIBezierPath

( lineWidth

, flatness

, ...) apply to all the way, with all its subpackages.



To draw curves with different line widths, you need to create multiple bezier paths.

+5


source







All Articles