     //
     //--------------------------------------------------------------------------
     
-    //----------------------------------
-    //  measuredWidth
-    //----------------------------------
-    
-    public function get measuredWidth():Number
-    {
-        // If we use device fonts, then the unscaled width is 
-        // textWidth * scaleX / scaleY
-        
-        var textIndent:Number = getStyle("textIndent");
-        
-        if (!stage || embedFonts)
-            return textWidth + textIndent + TEXT_WIDTH_PADDING;
-        
-        const m:Matrix = transform.concatenatedMatrix;
-        
-        // textIndent is also scaled
-        return Math.abs(((textWidth + textIndent) * m.a / m.d)) + TEXT_WIDTH_PADDING;
-    }
-    
-    //----------------------------------
-    //  measuredHeight
-    //----------------------------------
-    
-    public function get measuredHeight():Number
-    {
-        // If we use device fonts, then the unscaled height is 
-        // textHeight * scaleX / scaleY
-        
-        if (!stage || embedFonts)
-            return textHeight + TEXT_HEIGHT_PADDING;
-        
-        const m:Matrix = transform.concatenatedMatrix;
-        
-        // FIXME (jasonsj): gutter appears to scale as well. update UITextField measuredHeight?
-        return Math.abs((textHeight * m.a / m.d)) + TEXT_HEIGHT_PADDING;
+    public function get measuredTextSize():Point
+    {
+        if (!_measuredTextSize)
+        {
+            _measuredTextSize = new Point();
+            invalidateTextSizeFlag = true;
+        }
+        
+        if (invalidateTextSizeFlag)
+        {
+            // size always includes textIndent and TextField gutters
+            var textIndent:Number = getStyle("textIndent");
+            const m:Matrix = transform.concatenatedMatrix;
+            
+            // short circuit scaling workaround if off stage, using embedded fonts, or no scaling
+            if (!stage || embedFonts || (m.a == 1 && m.d == 1))
+            {
+                _measuredTextSize.x = textWidth + textIndent + TEXT_WIDTH_PADDING
+                _measuredTextSize.y = textHeight + TEXT_HEIGHT_PADDING;
+                
+                return _measuredTextSize;
+            }
+            
+            // when scaling, remove/add to stage for consistent measurement
+            var originalParent:DisplayObjectContainer = parent;
+            var index:int = parent.getChildIndex(this);
+            
+            // remove from display list
+            if (originalParent is UIComponent)
+                UIComponent(originalParent).$removeChild(this);
+            else
+                originalParent.removeChild(this);
+            
+            _measuredTextSize.x = textWidth + textIndent + TEXT_WIDTH_PADDING
+            _measuredTextSize.y = textHeight + TEXT_HEIGHT_PADDING;
+            
+            // add to display list
+            if (originalParent is UIComponent)
+                UIComponent(originalParent).$addChildAt(this, index);
+            else
+                originalParent.addChildAt(this, index);
+            
+            // If we use device fonts, then the unscaled sizes are
+            // textWidth * scaleX / scaleY
+            // textHeight * scaleX / scaleY 
+            if (m.a != m.d)
+            {
+                var scaleFactor:Number = (m.a / m.d);
+                
+                // textIndent and gutter are also scaled
+                _measuredTextSize.x = Math.abs(_measuredTextSize.x * scaleFactor);
+                _measuredTextSize.y = Math.abs(_measuredTextSize.y * scaleFactor);
+            }
+            
+            invalidateTextSizeFlag = false;
+        }
+        
+        return _measuredTextSize;
     }
     
     //----------------------------------

            }
            
            invalidateStyleFlag = false;
        }
    }
    


package spark.components.supportClasses
{
import flash.display.DisplayObjectContainer;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.TextEvent;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.text.Font;
import flash.text.TextField;
import flash.text.TextFieldType;
