mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
[ASStackLayoutSpec] Performance improvements (#2470)
* Initial commit for ASStackLayoutSpec improvements * Remove the lock in ASStackLayoutSpec and make the ASStackLayoutSpecStyle const I think we don't need lock here as the style already has a lock while we set the value * Add ASStackLayoutSpecItem that replaces layout specific items * Prevent baseline pass if not needed * Update comments
This commit is contained in:
committed by
GitHub
parent
ca203158da
commit
611894329a
@@ -13,13 +13,15 @@
|
||||
#import "ASStackPositionedLayout.h"
|
||||
|
||||
struct ASStackBaselinePositionedLayout {
|
||||
const std::vector<ASLayout *> sublayouts;
|
||||
const CGFloat crossSize;
|
||||
const CGFloat ascender;
|
||||
const CGFloat descender;
|
||||
|
||||
const std::vector<ASStackLayoutSpecItem> items;
|
||||
const CGFloat crossSize;
|
||||
const CGFloat ascender;
|
||||
const CGFloat descender;
|
||||
|
||||
/** Given a positioned layout, computes each child position using baseline alignment. */
|
||||
static ASStackBaselinePositionedLayout compute(const ASStackPositionedLayout &positionedLayout,
|
||||
const ASStackLayoutSpecStyle &style,
|
||||
const ASSizeRange &constrainedSize);
|
||||
|
||||
static BOOL needsBaselineAlignment(const ASStackLayoutSpecStyle &style);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user