Skip to main content
Known Participant
October 17, 2009
Question

clipAndEnableScrolling in SkinnableContainerremoved?

  • October 17, 2009
  • 1 reply
  • 1673 views

Hey,

I just noticed that clipAndEnableScrolling was removed from the SkinnableContainer/SkinnableDataContainer and am wondering why.  I would like to be able to set this to true in a SkinnableContainer, so the Group can have an arbitrary size and I can drag it around inside of the fixed-sized SkinnableContainer (for instance, if an Image is large, and I can only see 1/4 of it, I would like to be able to drag it around to crop it, using skinnable container with the contentGroup having a contentWidth/contentHeight of the image, to the right size, but I need clipAndEnableScrolling).

Is there any work around for this, or what's the plan?  I would like to update the scrollRect on a contentGroup inside the SkinnableContainer, that's it , using clipAndEnableScrolling.

Thanks for the help,

Lance

This topic has been closed for replies.

1 reply

Participant
October 19, 2009

The clipAndEnableScrolling property was removed because SkinnableContainer and SkinnableDataContainer no longer implement the IViewport interface.  The IViewport interface was designed for components that implemented scrolling directly, whose actual size was the same as the viewport's size, i.e.  the same size as the clipping rectangle.  This doesn't match sitautions like SkinnableContainer, where the IViewport API is delegated to the container's contentGroup. There were other design problems with implementing IViewport in this way and rather than try and resolve them all now, we've removed the "implements IVIewport" code from SkinnableContainer, and SkinnableDataContainer.

This change does not effect components whose skin supports scrolling, like List.

To make a SkinnableContainer clip its content you'll have to set the clipAndEnableScrolling property of its contentGroup (which is an IViewport).  If you've created a skin for your SkinnableContainer then you can just set the flag there.  If not, you'll have to defer setting the property until the default skin is loaded.  Although if you're not defining a skin, then perhaps you should use Group instead of SkinnableContainer.

Having set clipAndEnableScrolling=true, you can move the scrollRect around by changing the contentGroup's verticalScrollPosition and horizontalScrollPosition.