mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fixes to baseline stack alignment
1) Set the ascender/descender of an ASTextNode when the attributeString is set. Previously ascender/descender were only being computed in `setValuesFromLayoutable` and only when the attribute string was not nil. May make sense to remove the computation from `setValuesFromLayoutable` entirely. 2) Remove ability to allow different children of a stack spec to aling to different baselines. This wasn't working before and I'm not convinced it is possible to do properly/useful enough to invest the time. 3) Have all stack spec run `ASStackBaselinePositionedLayout::compute` to compute the stack's ascender and descender. Even if the stack isn't aligning its children to a baseline, the stack itself may be a child of another stack that IS aligning to a baseline.
This commit is contained in:
@@ -45,9 +45,9 @@ typedef NS_ENUM(NSUInteger, ASStackLayoutAlignItems) {
|
||||
ASStackLayoutAlignItemsCenter,
|
||||
/** Expand children to fill cross axis */
|
||||
ASStackLayoutAlignItemsStretch,
|
||||
/** Children align to their first baseline. Only available for horizontal stack nodes */
|
||||
/** Children align to their first baseline. Only available for horizontal stack spec */
|
||||
ASStackLayoutAlignItemsBaselineFirst,
|
||||
/** Children align to their last baseline. Only available for horizontal stack nodes */
|
||||
/** Children align to their last baseline. Only available for horizontal stack spec */
|
||||
ASStackLayoutAlignItemsBaselineLast,
|
||||
};
|
||||
|
||||
@@ -66,8 +66,4 @@ typedef NS_ENUM(NSUInteger, ASStackLayoutAlignSelf) {
|
||||
ASStackLayoutAlignSelfCenter,
|
||||
/** Expand to fill cross axis */
|
||||
ASStackLayoutAlignSelfStretch,
|
||||
/** Children align to their first baseline. Only available for horizontal stack nodes */
|
||||
ASStackLayoutAlignSelfBaselineFirst,
|
||||
/** Children align to their last baseline. Only available for horizontal stack nodes */
|
||||
ASStackLayoutAlignSelfBaselineLast,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user