Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Conversation

@maicki
Copy link
Contributor

@maicki maicki commented Jun 8, 2016

Fix original PR ( #1673 ) that was reverted (#1717)

  • Layout should happen with size as large as possible
  • Fix wrong logic around layout _hasDirtyLayout check

// with negative sizes after applying margins, which will cause
// measureWithSizeRange: on subnodes to assert.
if (!CGRectEqualToRect(bounds, CGRectZero)) {
_placeholderLayer.frame = bounds;
Copy link
Contributor

Choose a reason for hiding this comment

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

@maicki I think this change may be overwriting a recent fix that added the lines _shouldHavePlaceholderLayer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep I adjusted the code based on the recent changes we did

@ghost ghost added CLA Signed labels Jul 12, 2016
@Adlai-Holler
Copy link
Contributor

I've got nothing to add to Scott's comments – 👌

@ghost ghost added the CLA Signed label Jul 15, 2016
{
// Normally measure will be called before layout occurs. If this doesn't happen, nothing is going to call it at all.
// We simply call measureWithSizeRange: using a size range equal to whatever bounds were provided to that element
if (self.supernode == nil && !self.supportsRangeManagedInterfaceState && [self _hasDirtyLayout]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@maicki what about ASViewController? I think there is a way to override the constrainedSize, but the .node has no supernode, is not range managed, etc. This may be handled by _hasDirtyLayout, not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

We probably want to grab the lock here, at least while checking these three properties. If we don't, the value of one or more could change as the condition is being evaluated... There is also locking overhead in each method as it is re-acquired.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@appleguy In ASViewController we pass in the overwritten constrained size in measureWithSizeRange: so this will calling through to the measure method and dirty layout is false

Will add acquiring a lock for supportsRangeManagedInterfaceState and check for has dirty layout. In [self supernode] we already grab a lock

@appleguy appleguy merged commit 359785a into facebookarchive:master Jul 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants