     protected function endDraw(g:Graphics):void
     {
         g.endFill();
-    }
-    
+    
+    }
+
+    /**
+     *  @private
+     *  Returns the bounds of the element, including stroke in local coordinates.
+     */  
+    protected function getStrokeBounds():Rectangle
+    {
+        var strokeBounds:Rectangle = getStrokeExtents(false /*postLayoutTransform*/);
+        strokeBounds.x += measuredX;
+        strokeBounds.width += width;
+        strokeBounds.y += measuredY;
+        strokeBounds.height += height;
+        return strokeBounds;
+    }
+
     /**
      *  @private
      */  

        // otherwise subsequent fills could get messed up.
        g.beginFill(0, 0);
    }
    
    /**
     *  Draw the element. This is the second of three steps taken during the drawing
     *  process. Override this method to implement your drawing. The stroke

    protected function beginDraw(g:Graphics):void
    {
        if (stroke)
        {
            var strokeBounds:Rectangle = getStrokeBounds();
            strokeBounds.offset(drawX, drawY);
            stroke.apply(g, strokeBounds, new Point(drawX, drawY));
        }
        else
            g.lineStyle();
            
