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

Make text tool label more configurable via ACEDrawingViewDelegate; fix several bugs #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

stevelandeyasana
Copy link
Owner

@stevelandeyasana stevelandeyasana commented Jul 11, 2018

This is a copy of ACEDrawingView#96 for internal review by Asana.

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]
  1. ACEDrawingViewDelegate has a new optional method which allows the delegate to configure those properties before the label is displayed: [delegate labelViewNeedsConfiguration:label]
  2. Demonstrate usage in the demo app
  3. Add a hotfix for incorrect text metrics
  4. Add fix for crash when adding more than one text object at a time
  5. Fix incorrect class conformance check which triggered number 5 above

@stevelandeyasana stevelandeyasana changed the title Make text tool label more configurable via ACEDrawingViewDelegate Make text tool label more configurable via ACEDrawingViewDelegate; fix several bugs Jul 11, 2018
Copy link
Collaborator

@TheDom TheDom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


_globalInsets = CGSizeMake(12, 12);
_closeButtonOffset = CGPointMake(0, 0);
_rotateButtonOffset = CGPointMake(0, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] We could use CGPointZero

_labelView.textColor = self.lineColor;
_labelView.fontName = self.drawingView.draggableTextFontName ?: [UIFont systemFontOfSize:_labelView.fontSize].fontName;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: Is there a special reason why the order was swapped?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly just aesthetics.

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.

2 participants