mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-03 11:21:06 +00:00
Need some more locks for working with calculated yoga layouts (#1388)
This commit is contained in:
parent
510000ee85
commit
872e89b772
@ -286,6 +286,7 @@
|
|||||||
|
|
||||||
- (void)invalidateCalculatedYogaLayout
|
- (void)invalidateCalculatedYogaLayout
|
||||||
{
|
{
|
||||||
|
ASLockScopeSelf();
|
||||||
YGNodeRef yogaNode = self.style.yogaNode;
|
YGNodeRef yogaNode = self.style.yogaNode;
|
||||||
if (yogaNode && [self shouldHaveYogaMeasureFunc]) {
|
if (yogaNode && [self shouldHaveYogaMeasureFunc]) {
|
||||||
// Yoga internally asserts that MarkDirty() may only be called on nodes with a measurement function.
|
// Yoga internally asserts that MarkDirty() may only be called on nodes with a measurement function.
|
||||||
@ -338,6 +339,7 @@
|
|||||||
|
|
||||||
- (void)calculateLayoutFromYogaRoot:(ASSizeRange)rootConstrainedSize
|
- (void)calculateLayoutFromYogaRoot:(ASSizeRange)rootConstrainedSize
|
||||||
{
|
{
|
||||||
|
ASScopedLockSet lockSet = [self lockToRootIfNeededForLayout];
|
||||||
ASDisplayNode *yogaRoot = self.yogaRoot;
|
ASDisplayNode *yogaRoot = self.yogaRoot;
|
||||||
|
|
||||||
if (self != yogaRoot) {
|
if (self != yogaRoot) {
|
||||||
@ -358,7 +360,6 @@
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
||||||
// Prepare all children for the layout pass with the current Yoga tree configuration.
|
// Prepare all children for the layout pass with the current Yoga tree configuration.
|
||||||
ASDisplayNodePerformBlockOnEveryYogaChild(self, ^(ASDisplayNode *_Nonnull node) {
|
ASDisplayNodePerformBlockOnEveryYogaChild(self, ^(ASDisplayNode *_Nonnull node) {
|
||||||
node.yogaLayoutInProgress = YES;
|
node.yogaLayoutInProgress = YES;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user