From 4d572411e0d052c0b776f6a550c31daccadd5ebd Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 21 Oct 2021 16:19:11 +0100 Subject: [PATCH] FlexBox: Update the default value of FlexItem::alignSelf to match CSS implementations --- BREAKING-CHANGES.txt | 23 +++++++++++++++++++ .../juce_gui_basics/layout/juce_FlexItem.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/BREAKING-CHANGES.txt b/BREAKING-CHANGES.txt index 97cdf71203..7ffb08a11e 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -4,6 +4,29 @@ JUCE breaking changes develop ======= +Change +------ +FlexItem::alignSelf now defaults to "autoAlign" rather than "stretch". + +Possible Issues +--------------- +FlexBox layouts will be different in cases where FlexBox::alignItems is set to +a value other than "stretch". This is because each FlexItem will now default +to using the FlexBox's alignItems value. Layouts that explicitly set +FlexItem::alignSelf on each item will not be affected. + +Workaround +---------- +To restore the previous layout behaviour, set FlexItem::alignSelf to "stretch" +on all FlexItems that would otherwise use the default value for alignSelf. + +Rationale +--------- +The new behaviour more closely matches the behaviour of CSS FlexBox +implementations. In CSS, "align-self" has an initial value of "auto", which +computes to the parent's "align-items" value. + + Change ------ Functions on AudioPluginInstance that can add parameters have been made diff --git a/modules/juce_gui_basics/layout/juce_FlexItem.h b/modules/juce_gui_basics/layout/juce_FlexItem.h index 6d96c5c76c..67841a6d7a 100644 --- a/modules/juce_gui_basics/layout/juce_FlexItem.h +++ b/modules/juce_gui_basics/layout/juce_FlexItem.h @@ -104,7 +104,7 @@ public: This determines the alignment of the item along the cross-axis (perpendicular to the direction of flow). */ - AlignSelf alignSelf = AlignSelf::stretch; + AlignSelf alignSelf = AlignSelf::autoAlign; //============================================================================== /** This constant can be used for sizes to indicate that 'auto' mode should be used. */