Cirque icon indicating copy to clipboard operation
Cirque copied to clipboard

Feature/counter clockwise

Open seanclen opened this issue 7 years ago • 2 comments

This pull request will allow the stroke to progress counter-clockwise along a path. When calculating the start and final angles in drawGradient() and drawSolid(), a quick overload of the + operator on CGFloat lets us add or subtract based on the isClockwise: Bool property. In both methods, the property is also used when calling processPath.addArc().

  • Added public isClockwise property
  • Added CGFloat extension
  • Fixed small grammatical errors in comments

The idea behind overloading the operator on CGFloat is to allow the code to remain similar in simplicity and brevity. Rather use one extension instead of adding more than a dozen lines of repetitive conditionals.

seanclen avatar May 18 '18 05:05 seanclen

Thanks a lot for another PR 🙏 I will have a look as soon as I can - probably by the end of the week.

philipengberg avatar May 22 '18 12:05 philipengberg

Code looks good, though 👌 Neat trick with the CGFloat operator overload. As I said, I'll give a spin as soon as I can.

philipengberg avatar May 22 '18 12:05 philipengberg