From 6d7f81408034d178419350e143cc953374108fda Mon Sep 17 00:00:00 2001 From: Matthew Wagerfield Date: Fri, 25 Apr 2014 20:28:39 +0100 Subject: [PATCH] :gb: Updated README. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bf20c44..b611707 100644 --- a/README.md +++ b/README.md @@ -37,15 +37,15 @@ The amount of motion that each layer moves by depends on 3 contributing factors: The calculation for this motion is as follows: ```coffeescript -xMotion = parentElement.width / scalarX * layerDepth -yMotion = parentElement.height / scalarY * layerDepth +xMotion = parentElement.width * (scalarX / 100) * layerDepth +yMotion = parentElement.height * (scalarY / 100) * layerDepth ``` So for a layer with a `data-depth` value of `0.5` within a scene that has both the `scalarX` and `scalarY` values set to `10` ( *the default* ) where the containing scene element is `1000px x 1000px`, the total motion of the layer in both `x` and `y` would be: ```coffeescript -xMotion = 1000 / 10 * 0.5 = 50 # 50px of positive and negative motion in x -yMotion = 1000 / 10 * 0.5 = 50 # 50px of positive and negative motion in y +xMotion = 1000 * (10 / 100) * 0.5 = 50 # 50px of positive and negative motion in x +yMotion = 1000 * (10 / 100) * 0.5 = 50 # 50px of positive and negative motion in y ``` ## Behaviours