-
1. Re: Internal scaleX is negative and can't be reset
Flex harUI Mar 22, 2011 11:11 PM (in response to turbidity)If you are using Flex 4.1, you might be falling victim to the
layoutDirection not being set to "ltr" for your UIComponents.
-
2. Re: Internal scaleX is negative and can't be reset
turbidity Mar 23, 2011 8:32 AM (in response to Flex harUI)Thanks for the suggestion. However, layoutDirection is 'ltr' for this component and for its parent. I also noticed the _layoutFeatures property. This is null in the parent component, but populated in the component. Looking into it, the explicit scaleX properties are all set to the correct value (1) before I do my workaround, however, the computedMatrix property of the AdvancedLayoutFeatures class has a property called 'a' that is set to -1. I don't know if this is a symptom of the problem or could conceivably be the cause. I'm not doing anything with layoutDirection or _layoutFeatures myself. This component was originally a Sprite, so I wasn't mucking around with any of that.
I'll have to do some research on this when I get the chance, but I certainly welcome any more suggestions!
-
3. Re: Internal scaleX is negative and can't be reset
Flex harUI Mar 23, 2011 11:22 PM (in response to turbidity)"a" = scaleX.
Did you try setting a conditional breakpoint on the scaleX setter?
-
4. Re: Internal scaleX is negative and can't be reset
turbidity Mar 24, 2011 3:18 PM (in response to Flex harUI)Yeah, I put a breakpoint in the setter and the setter never gets called. $scaleX is -1 from the start. Only once I change the value does the setter run, and then the _scaleX property shows the right value, but $scaleX has the negative value.
-
5. Re: Internal scaleX is negative and can't be reset
Flex harUI Mar 24, 2011 8:28 PM (in response to turbidity)Is it -1 at the constructor? Are these classes bound to a SWF asset?
-
6. Re: Internal scaleX is negative and can't be reset
barg27 Dec 3, 2011 12:37 PM (in response to turbidity)I'm seeing this same behavior. I have a Flex 4.5 application that is internationalized for right-to-left languages. I have a SWFLoader that I manually set the layoutDirection property to "ltr". If I change the language to Arabic, on the first showing, everything displays properly. If I switch it back to English, everything displays correctly - except for the content in the SWFLoader (Bitmap). The content is flipped on the x-axis. A breakpoint reveals the values for layoutDirection is still properly set to "ltr", the scaleX is 1, but the $scaleX value is -1.
I tried a fix similar to what turbidity tried... something like this (extending SWFLoader):
override public function set scaleX( value:Number ):void { if( mx_internal::$scaleX < 0 ) super.scaleX = -value; else super.scaleX = value; }The above snippet just renders the SWFLoader blank. With the layoutDirection explicitly set to "ltr", I would have to think this is a framework bug somewhere. Just not sure what a good workaround is yet.
-
7. Re: Internal scaleX is negative and can't be reset
Flex harUI Dec 4, 2011 11:11 PM (in response to barg27)Post a simple test case.
-
8. Re: Internal scaleX is negative and can't be reset
barg27 Dec 5, 2011 10:04 AM (in response to Flex harUI)Hmm... of course. I tried a scaled down model of the application and it works fine. I'll try to post the workaround/solution that we come up with when I find it. Hopefully I'll have an explanation why it's behaving this way, too.


