Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Adobe Flex SDK 4.1 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce:
1. Create a VGroup
2. Create two HGroups with labels "hello world" inside of them. Add one of them straight away and another later at, say, some button click event.
3. Click the button to add second HGroup.
Actual Results:
1. My and my team's heads exploded.
2. First group with label looks great.
3. Second group with label is horizontally reversed.
Expected Results:
All elements looking normal and non-reversed.
Workaround (if any):
Explicitly set layoutDirection = LTR on your VGroup instance.
Cause:
Apparently, content of the component gets reversed depending on the layout direction difference between the component and its parent. In UIComponent on 7635, we have:
// If this element's layoutDirection doesn't match its parent's, then
// set the _layoutFeatures.mirror flag. Similarly, if mirroring isn't
// required, then clear the _layoutFeatures.mirror flag.
const mirror:Boolean = (parentElt)
? (parentElt.layoutDirection != thisLayoutDirection)
: (LayoutDirection.LTR != thisLayoutDirection);
if ((_layoutFeatures) ? (mirror != _layoutFeatures.mirror) : mirror)
{ if (_layoutFeatures == null) initAdvancedLayoutFeatures(); _layoutFeatures.mirror = mirror; // width may have already been set _layoutFeatures.layoutWidth = _width; invalidateTransform(); }After getting to debugger we found that layout direction is set on HGroup but not on VGroup, which means when compared they result in "mirror" being set to true. So a top level issue is somewhere in VGroup, where layout direction doesn't get set initially. Nevertheless, I think the statement on 7639 asks for trouble big time and should actually account for all possible values the parameter can receive.
Something like:
const mirror:Boolean = (parentElt) ?
(parentElt.layoutDirection != null && thisLayoutDirection != null && parentElt.layoutDirection != thisLayoutDirection) :
(thisLayoutDirection != null && LayoutDirection.LTR != thisLayoutDirection);
should get rid of the issue for good.