diff --git a/source/feathers/layout/HorizontalLayout.as b/source/feathers/layout/HorizontalLayout.as index ed2f4a193a..23332d5408 100644 --- a/source/feathers/layout/HorizontalLayout.as +++ b/source/feathers/layout/HorizontalLayout.as @@ -473,7 +473,12 @@ package feathers.layout { continue; } - item.x = item.pivotX + positionX; + var pivotX:Number = item.pivotX; + if(pivotX !== 0) + { + pivotX *= item.scaleX; + } + item.x = pivotX + positionX; var itemWidth:Number; if(hasDistributedWidth) { @@ -668,12 +673,18 @@ package feathers.layout continue; } + var pivotY:Number = item.pivotY; + if(pivotY !== 0) + { + pivotY *= item.scaleY; + } + //in this section, we handle vertical alignment and percent //height from HorizontalLayoutData if(this._verticalAlign == VerticalAlign.JUSTIFY) { //if we justify items vertically, we can skip percent height - item.y = item.pivotY + boundsY + this._paddingTop; + item.y = pivotY + boundsY + this._paddingTop; item.height = availableHeightMinusPadding; } else @@ -735,17 +746,17 @@ package feathers.layout { case VerticalAlign.BOTTOM: { - item.y = item.pivotY + boundsY + verticalAlignHeight - this._paddingBottom - item.height; + item.y = pivotY + boundsY + verticalAlignHeight - this._paddingBottom - item.height; break; } case VerticalAlign.MIDDLE: { - item.y = item.pivotY + boundsY + this._paddingTop + Math.round((verticalAlignHeight - this._paddingTop - this._paddingBottom - item.height) / 2); + item.y = pivotY + boundsY + this._paddingTop + Math.round((verticalAlignHeight - this._paddingTop - this._paddingBottom - item.height) / 2); break; } default: //top { - item.y = item.pivotY + boundsY + this._paddingTop; + item.y = pivotY + boundsY + this._paddingTop; } } } diff --git a/source/feathers/layout/VerticalLayout.as b/source/feathers/layout/VerticalLayout.as index 2ea91a9326..22a36b2fde 100644 --- a/source/feathers/layout/VerticalLayout.as +++ b/source/feathers/layout/VerticalLayout.as @@ -619,7 +619,12 @@ package feathers.layout { continue; } - item.y = item.pivotY + positionY; + var pivotY:Number = item.pivotY; + if(pivotY !== 0) + { + pivotY *= item.scaleY; + } + item.y = pivotY + positionY; var itemWidth:Number = item.width; var itemHeight:Number; if(hasDistributedHeight) @@ -822,12 +827,18 @@ package feathers.layout continue; } + var pivotX:Number = item.pivotX; + if(pivotX !== 0) + { + pivotX *= item.scaleX; + } + //in this section, we handle horizontal alignment and percent //width from VerticalLayoutData if(this._horizontalAlign == HorizontalAlign.JUSTIFY) { //if we justify items horizontally, we can skip percent width - item.x = item.pivotX + boundsX + this._paddingLeft; + item.x = pivotX + boundsX + this._paddingLeft; item.width = availableWidthMinusPadding; } else @@ -889,19 +900,19 @@ package feathers.layout { case HorizontalAlign.RIGHT: { - item.x = item.pivotX + boundsX + horizontalAlignWidth - this._paddingRight - item.width; + item.x = pivotX + boundsX + horizontalAlignWidth - this._paddingRight - item.width; break; } case HorizontalAlign.CENTER: { //round to the nearest pixel when dividing by 2 to //align in the center - item.x = item.pivotX + boundsX + this._paddingLeft + Math.round((horizontalAlignWidth - this._paddingLeft - this._paddingRight - item.width) / 2); + item.x = pivotX + boundsX + this._paddingLeft + Math.round((horizontalAlignWidth - this._paddingLeft - this._paddingRight - item.width) / 2); break; } default: //left { - item.x = item.pivotX + boundsX + this._paddingLeft; + item.x = pivotX + boundsX + this._paddingLeft; } } }