Skip to content

Commit

Permalink
fixes #2493 repeaters with reduced copies
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymovin committed Mar 20, 2021
1 parent c2e3877 commit 339cef1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion player/js/utils/shapes/RepeaterModifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
renderFlag = cont < copies;
this._groups[i]._render = renderFlag;
this.changeGroupRender(this._groups[i].it, renderFlag);
if (!renderFlag) {
var elems = this.elemsData[i].it;
var transformData = elems[elems.length - 1];
if (transformData.transform.op.v !== 0) {
transformData.transform.op._mdf = true;
transformData.transform.op.v = 0;
} else {
transformData.transform.op._mdf = false;
}
}
cont += 1;
}

Expand Down Expand Up @@ -167,7 +177,10 @@ RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
jLen = itemsTransform.length;
items[items.length - 1].transform.mProps._mdf = true;
items[items.length - 1].transform.op._mdf = true;
items[items.length - 1].transform.op.v = this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
items[items.length - 1].transform.op.v = this._currentCopies === 1
? this.so.v
: this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));

if (iteration !== 0) {
if ((i !== 0 && dir === 1) || (i !== this._currentCopies - 1 && dir === -1)) {
this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
Expand Down

0 comments on commit 339cef1

Please sign in to comment.