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

Create and set delegate for clip corner layers within ASDisplayNode #1029

Merged
merged 2 commits into from
Jul 18, 2018

Conversation

maicki
Copy link
Contributor

@maicki maicki commented Jul 15, 2018

Currently the delegate for all rounded corner layers are set to the owning display node. This has the effect that actionForLayer:forKey: is called on the node for every corner layer although it should have their own delegate. In actionForLayer:forKey: we assert that the node is layer backed. This is not necessary needed if using corner rounding though.
This diff will create an ASDisplayNodeCornerLayerDelegate and set it as delegate for the corner layers.

Fixes #1020, #910

@maicki maicki force-pushed the MSClipCornerLayersDelegate branch 3 times, most recently from 2adc7a8 to 8eeb5ba Compare July 16, 2018 15:27
@ghost
Copy link

ghost commented Jul 16, 2018

🚫 CI failed with log

Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

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

Nice catch!

@nguyenhuy
Copy link
Member

@maicki Did you run the test suite locally?

@maicki
Copy link
Contributor Author

maicki commented Jul 16, 2018

@nguyenhuy Yeah but I would rather wait for the CI to pass tbh

@nguyenhuy
Copy link
Member

👍


- (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event
{
return nil;
Copy link
Member

Choose a reason for hiding this comment

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

  • Should we return (id)kCFNull to prevent the default action, like we do for other layers? That suppresses the default action (e.g. fade in).
  • Is this different than setting no delegate on the layers?
  • Let's share one single instance of this rather than creating one for each layer.

Copy link
Contributor Author

@maicki maicki Jul 16, 2018

Choose a reason for hiding this comment

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

  • Yes this should return (id)kCFNull I will change that.
  • Yes setting no delegate should animate the layer
  • We are already sharing one instance if you look where we create the shared delegate for all of the corner layers within the code

@ghost
Copy link

ghost commented Jul 16, 2018

🚫 CI failed with log

@ghost
Copy link

ghost commented Jul 16, 2018

🚫 CI failed with log

@maicki maicki force-pushed the MSClipCornerLayersDelegate branch from fca8083 to 5c2a135 Compare July 17, 2018 15:23
@ghost
Copy link

ghost commented Jul 17, 2018

🚫 CI failed with log

@ghost
Copy link

ghost commented Jul 17, 2018

🚫 CI failed with log

@nguyenhuy nguyenhuy merged commit b1f6030 into master Jul 18, 2018
@nguyenhuy nguyenhuy deleted the MSClipCornerLayersDelegate branch July 18, 2018 09:56
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Oct 2, 2018
…extureGroup#1029)

* Create and use ASDisplayNodeCornerLayerDelegate

* Return kCFNull for actionForLayer:forKey:
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.

None yet

3 participants