 		
 		if (rightShadow || topShadow)
 		{
-			var trWidth:Number = Math.min(trRadius + widthThickness,
+			var trWidth:Number = Math.min(trRadius + rightThickness + distance,
 										  maxCornerWidth);
-			var trHeight:Number = Math.min(trRadius + heightThickness,
+			var trHeight:Number = Math.min(trRadius + topThickness + distance,
 										   maxCornerHeight);
 
 			matrix.tx = x + width + rightThickness - shadow.width;

			
		if (rightShadow || bottomShadow)
		{
			var brWidth:Number = Math.min(brRadius + widthThickness,
										  maxCornerWidth);
			var brHeight:Number = Math.min(brRadius + heightThickness,
										   maxCornerHeight);

			matrix.tx = x + width + rightThickness - shadow.width; 

		
		if (leftShadow || bottomShadow)
		{
			var blWidth:Number = Math.min(blRadius + leftThickness + distance,
										  maxCornerWidth);
			var blHeight:Number = Math.min(blRadius + bottomThickness + distance,
										   maxCornerHeight);

			matrix.tx = x - leftThickness;
