acerbetti / ACEDrawingView

An open source iOS component to create a drawing app
Apache License 2.0
665 stars 171 forks source link

Make text tool label more configurable via ACEDrawingViewDelegate #96

Closed stevelandeyasana closed 6 years ago

stevelandeyasana commented 6 years ago

Some people (i.e. me) want to customize several aspects of ACEDrawingLabelView which are not currently exposed to users of the framework. This PR makes the changes necessary to enable that customization.

  1. ACEDrawingLabelView has new configurable properties that replace previously hard-coded values:
    • [close|rotate]ButtonOffset
    • [close|rotate]ButtonSize
    • [close|rotate]Button
    • shadow[Color|Opacity|Radius|Offset]
  2. ACEDrawingViewDelegate has a new optional method which allows the delegate to configure those properties before the label is displayed: [delegate labelViewNeedsConfiguration:label]
  3. Demonstrate usage in the demo app
  4. Add a hotfix for incorrect text metrics
  5. Add fix for crash when adding more than one text object at a time
  6. Fix incorrect class conformance check which triggered number 5 above
stevelandeyasana commented 6 years ago

I do see a v3 branch lying around, but I didn't want to base this change I need on prerelease code. :-)

acerbetti commented 6 years ago

Thanks for your code, it's very clear and well done. I'm merging it.

Don't worry too much about V3. I started to work on it when I had a little bit of free time, but it's not the case anymore... :(