MCPcopy
hub / github.com/metafizzy/flickity / isPositionApprox

Function isPositionApprox

test/unit/position-cells.js:6–11  ·  view source on GitHub ↗
( value, expected )

Source from the content-addressed store, hash-verified

4
5// position values can be off by 0.1% or 1px
6function isPositionApprox( value, expected ) {
7 var isPercent = value.indexOf('%') != -1;
8 value = parseFloat( value );
9 var diff = Math.abs( expected - value );
10 return isPercent ? diff < 0.1 : diff <= 1;
11}
12
13// loop through cells and check position values against expecteds
14function checkCellPositions( flkty, expecteds ) {

Callers 1

checkCellPositionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…