From 4ed6cf702ecbc89d03a4042a2f68405d71e9d736 Mon Sep 17 00:00:00 2001 From: Frankie Robertson Date: Sat, 30 Jan 2016 19:41:56 +0200 Subject: [PATCH] Fix getXSnapLength/getYSnapLength to be only value which makes sense in dimensional terms --- src/scrollsnap-polyfill.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scrollsnap-polyfill.js b/src/scrollsnap-polyfill.js index 9c3714e..e82a237 100644 --- a/src/scrollsnap-polyfill.js +++ b/src/scrollsnap-polyfill.js @@ -476,8 +476,8 @@ // when using %, one snap is the length of element height / 100 * value return getHeight(obj) / 100 * declaration.value; } else { - // when using px, one snap is the length of element height / value - return getHeight(obj) / declaration.value; + // when using px, one snap is the value + return declaration.value; } return 0; @@ -496,8 +496,8 @@ // when using %, one snap is the length of element width / 100 * value return getWidth(obj) / 100 * declaration.value; } else { - // when using px, one snap is the length of element width / value - return getWidth(obj) / declaration.value; + // when using px, one snap is the value + return declaration.value; } return 0;