Fix Yoga flexshrink with min-width sizing issue
Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1
This commit is contained in:
Родитель
8970ee9f32
Коммит
2e085a388b
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
Checks: '>
|
||||
clang-diagnostic-*,
|
||||
'
|
||||
...
|
|
@ -2338,7 +2338,8 @@ static void YGDistributeFreeSpaceFirstPass(
|
|||
// first and second passes.
|
||||
deltaFreeSpace += boundMainSize - childFlexBasis;
|
||||
collectedFlexItemsValues.totalFlexShrinkScaledFactors -=
|
||||
flexShrinkScaledFactor;
|
||||
(-currentRelativeChild->resolveFlexShrink() *
|
||||
currentRelativeChild->getLayout().computedFlexBasis.unwrap());
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
|
|
Загрузка…
Ссылка в новой задаче