MCPcopy Index your code
hub / github.com/CreateJS/TweenJS / writeTransform

Function writeTransform

src/tweenjs/plugins/CSSPlugin.js:278–297  ·  view source on GitHub ↗
(list0, list1, ratio)

Source from the content-addressed store, hash-verified

276 }
277
278 function writeTransform(list0, list1, ratio) {
279 // check if we should just use the original transform strings:
280 if (ratio === 1) { return list1[1]; }
281 if (ratio === 0 || !list1[0]) { return list0[1]; }
282
283 // they match, we want to apply the ratio:
284 var str = "", l=list0.length, i, j, jl;
285 for (i=2; i<l; i++) {
286 var component0 = list0[i], component1 = list1[i];
287 str += component0[0]+"(";
288 for (j=1, jl=component0.length; j<jl; j+=2) {
289 str += component0[j]+(component1[j]-component0[j])*ratio; // value
290 str += component1[j+1] || component0[j+1]; // unit
291 if (j < jl-2) { str += ", "; }
292 }
293 str += ")";
294 if (i < l-1) { str += " "; }
295 }
296 return str;
297 }
298
299 /*
300

Callers 1

CSSPlugin.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected