      *  @private
      *  Calculates this LinearGradientStroke's transformation matrix.  
      */
-    private function calculateTransformationMatrix(rect:Rectangle, matrix:Matrix):void
+    private function calculateTransformationMatrix(targetBounds:Rectangle, matrix:Matrix, targetOrigin:Point):void
     {
         if (!compoundTransform)
         {
-            var w:Number = !isNaN(scaleX) ? scaleX : rect.width;
-            var bX:Number = !isNaN(x) ? x + rect.left : rect.left + (rect.width - w) / 2;
-            var bY:Number = !isNaN(y) ? y + rect.top : rect.top;
-            
-            
-            matrix.createGradientBox(w, rect.height, 
+            var w:Number = !isNaN(scaleX) ? scaleX : targetBounds.width;            
+            var bX:Number = !isNaN(x) ? x + targetOrigin.x : targetBounds.left;
+            var bY:Number = !isNaN(y) ? y + targetOrigin.y : targetBounds.top;
+                        
+            matrix.createGradientBox(w, targetBounds.height, 
                                     !isNaN(_angle) ? 
                                         _angle : rotationInRadians,
                                      bX, bY);   
         }
         else
-        {
-            matrix.identity();            
+        {            
+            matrix.identity(); 
             matrix.translate(GRADIENT_DIMENSION / 2, GRADIENT_DIMENSION / 2);
             matrix.scale(1 / GRADIENT_DIMENSION, 1 / GRADIENT_DIMENSION);
             matrix.concat(compoundTransform.matrix);
-            matrix.translate(rect.left, rect.top);
+            matrix.translate(targetOrigin.x, targetOrigin.y);
         }
     }
     

import flash.display.GraphicsGradientFill;
import flash.display.GraphicsStroke;
import flash.geom.Matrix;
import flash.geom.Rectangle;

import mx.core.mx_internal;

    /**
     *  @private
     */
    override public function createGraphicsStroke(targetBounds:Rectangle, targetOrigin:Point):GraphicsStroke
    {
        // The parent class sets the gradient stroke properties common to 
        // LinearGradientStroke and RadialGradientStroke 
        var graphicsStroke:GraphicsStroke = super.createGraphicsStroke(targetBounds, targetOrigin); 
        
        if (graphicsStroke)
        {
            // Set other properties specific to this LinearGradientStroke  
            GraphicsGradientFill(graphicsStroke.fill).type = GradientType.LINEAR; 
            calculateTransformationMatrix(targetBounds, commonMatrix, targetOrigin);
            GraphicsGradientFill(graphicsStroke.fill).matrix = commonMatrix; 
        }
        
