From 2e9282a3e58fe2e61cebb501795a55cdcae5f74f Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 8 Aug 2008 02:17:33 +0000 Subject: [PATCH] Make our measured size the size of the thing we're wrapping. Half the places we use FlexWrapper we do something like this anyway. Note that you can still override this by setting the width and height (which sets the explicitWidth, explicitHeight). git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@614 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flex/FlexWrapper.as | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/as/com/threerings/flex/FlexWrapper.as b/src/as/com/threerings/flex/FlexWrapper.as index 127bacd4..9d7bb972 100644 --- a/src/as/com/threerings/flex/FlexWrapper.as +++ b/src/as/com/threerings/flex/FlexWrapper.as @@ -34,7 +34,16 @@ public class FlexWrapper extends UIComponent { // don't capture mouse events in this wrapper mouseEnabled = false; + _obj = object; addChild(object); } + + override protected function measure () :void + { + measuredWidth = _obj.width; + measuredHeight = _obj.height; + } + + protected var _obj :DisplayObject; } }