Updated Branches: refs/heads/develop 6a715e970 -> 716f70bba
FLEX-33992 fix zero division issue Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/716f70bb Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/716f70bb Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/716f70bb Branch: refs/heads/develop Commit: 716f70bba77812322635374fae8937303d7db5ae Parents: 6a715e9 Author: Justin Mclean <[email protected]> Authored: Mon Dec 16 17:55:55 2013 +1100 Committer: Justin Mclean <[email protected]> Committed: Mon Dec 16 17:55:55 2013 +1100 ---------------------------------------------------------------------- frameworks/projects/spark/src/spark/components/Grid.as | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/716f70bb/frameworks/projects/spark/src/spark/components/Grid.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/components/Grid.as b/frameworks/projects/spark/src/spark/components/Grid.as index 59aefac..329274a 100644 --- a/frameworks/projects/spark/src/spark/components/Grid.as +++ b/frameworks/projects/spark/src/spark/components/Grid.as @@ -735,9 +735,9 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc { const gridViewLayout:GridViewLayout = centerGridView.gridViewLayout; const gridMaxHSP:Number = contentWidth - width; - const centerContentWidth:Number = Math.ceil(gridViewLayout.gridDimensionsView.getContentWidth()); - const centerMaxHSP:Number = centerContentWidth - centerGridView.width; - const hsp:Number = (centerMaxHSP / gridMaxHSP) * value; + const centerContentWidth:Number = Math.ceil(gridViewLayout.gridDimensionsView.getContentWidth()); + const centerMaxHSP:Number = centerContentWidth - centerGridView.width; + const hsp:Number = (gridMaxHSP > 0) ? (centerMaxHSP / gridMaxHSP) * value : 0; centerGridView.horizontalScrollPosition = hsp; @@ -853,7 +853,7 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc const gridMaxVSP:Number = contentHeight - height; const centerContentHeight:Number = Math.ceil(gridViewLayout.gridDimensionsView.getContentHeight()); const centerMaxVSP:Number = centerContentHeight - centerGridView.height; - const vsp:Number = gridMaxVSP == 0 ? 0 : (centerMaxVSP / gridMaxVSP) * value; + const vsp:Number = (gridMaxVSP > 0) ? (centerMaxVSP / gridMaxVSP) * value : 0; centerGridView.verticalScrollPosition = vsp;
