|
|
|
[
Permlink
| « Hide
]
Ella Mitelman - [09/10/08 06:21 PM ]
Scroller itself rotates correctly
I used a slightly revised version of the test app:
<?xml version="1.0" encoding="utf-8"?> <Application xmlns="http://ns.adobe.com/mxml/2009" xmlns:mx="library:adobe/flex/halo"> <Scroller width="100" height="100" id="sc" x="100" y="100"> <DataGroup id="g2" width="200"> <layout> <VerticalLayout/> </layout> <mx:ArrayCollection> <mx:String>Ella1</mx:String> <mx:String>Paul1</mx:String> <mx:String>Tom1</mx:String> <mx:String>Ella2</mx:String> <mx:String>Paul2</mx:String> <mx:String>Tom2</mx:String> <mx:String>Ella3</mx:String> <mx:String>Paul3</mx:String> <mx:String>Tom3</mx:String> <mx:String>Ella</mx:String> <mx:String>Paul</mx:String> <mx:String>Tom </mx:String> </mx:ArrayCollection> </DataGroup> </Scroller> <Button label="rotation" click = "g2.rotation=-15" /> </Application> The source of the problem is a null-reference through the bounds argument from TransformUtil::transformBounds(): var pt1:Point = matrix.deltaTransformPoint(bounds); // bounds is null! The source of the null value seems to be TransformUtil::calcUBoundsToFitTBounds(), which can return null if no solution is possible. RTE fixed with Revision: 3440 [ http://p01weblab02.macromedia.com/viewvc/opensource?view=rev&revision=3440 ]
RTE is gone, but there still 2 problems.
DataGroup data disappears after rotation, Group Scrollbar disappears after rotation. New files are attached <?xml version="1.0" encoding="utf-8"?>
<!-- http://bugs.adobe.com/jira/browse/SDK-16797 If the Scroller's viewport (a DataGroup in this case) is rotated is does inexplicably disappear. It's not entirely clear why this is however if an additional Group is added around the DataGroup then things work about as you'd expect. --> <Application xmlns="http://ns.adobe.com/mxml/2009" xmlns:mx="library:adobe/flex/halo"> <layout> <VerticalLayout gap="20"/> </layout> <Script> <![CDATA[ import flash.display.DisplayObject; import flex.graphics.graphicsClasses.GraphicElement; import flex.skin.DefaultComplexItemRenderer; import flex.skin.DefaultItemRenderer; public function mixItemRendererFunction(item:*):IFactory { if (item is DisplayObject || item is GraphicElement) return new ClassFactory(DefaultComplexItemRenderer); else return new ClassFactory(DefaultItemRenderer); } ]]> </Script> <Scroller height="150"> <Group> <DataGroup id="dg" transformX="100" transformY="125" itemRendererFunction="mixItemRendererFunction"> <layout> <VerticalLayout/> </layout> <mx:ArrayCollection> <mx:String>Ella1</mx:String> <mx:String>Paul1</mx:String> <mx:String>Tom1</mx:String> <mx:String>Ella2</mx:String> <mx:String>Paul2</mx:String> <mx:String>Tom2</mx:String> <mx:String>Ella3</mx:String> <mx:String>Paul3</mx:String> <mx:String>Tom3</mx:String> <mx:String>Ella</mx:String> <mx:String>Paul</mx:String> <mx:String>Tom </mx:String> </mx:ArrayCollection> </DataGroup> </Group> </Scroller> <Button label="set rotation" click = "dg.rotation -= 3"/> </Application> Note also: rotating the entire Scroller (not just its viewport) also works correctly, with or without the extra Group.
The problem here seems to be that ScrollerSkin::updateDisplayList() is setting the viewport LayoutItem's actual size to its pre-transform value, even though LayoutItem::setActualSize() defines the layout item's post-transform size. As a consequence of this, VerticalLayout::updateDisplayList() is applied to an unscaledWidth that's much to small, and when the scrollRect is set to that, the list's contents disappear. Although this is fixable, doing so is not a high priority. For now we'll document that setting the viewport's transform isn't supported. This bug's priority should be lowered. We've decided to just document this limitation rather than fix it. Added the following comment to FxScroller::set viewport
* Scroller does not support rotating the viewport directly. The viewport's * contents can be transformed arbitrarily but the viewport itself can not. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||