Skip to content

Commit

Permalink
FlexBox: Update the default value of FlexItem::alignSelf to match CSS…
Browse files Browse the repository at this point in the history
… implementations
  • Loading branch information
reuk committed Oct 26, 2021
1 parent 4c2dba0 commit 4d57241
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions BREAKING-CHANGES.txt
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/juce_gui_basics/layout/juce_FlexItem.h
Expand Up @@ -104,7 +104,7 @@ class JUCE_API FlexItem final
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. */
Expand Down

0 comments on commit 4d57241

Please sign in to comment.