get-single-axis-scale-from-info
Calculate the size and position of scaling on a single axis from anywhere on that axis. This works for any system that calculates from the top or left, like your browser's dom!
Installation
Download node at nodejs.org and install it, if you haven't already.
npm install get-single-axis-scale-from-info --save
Usage
// require modulevar getSingleAxisScaleFromInfo = ; // { size: 8, position: -8 } // { size: 2, position: 2 }
API
spec object parameters (required)
from: Number // The position to scale from on the axisscale: Number // The multiplier amount to scale from position listed abovesize: Number // Current length of the thing you are scalingposition: Number // The current position of the thing you are scaling (top or left)
returns
size: Number // The new size after performing scaleposition: Number // The new position after performing scale
License
MIT