bezier data memory management improved
diff --git a/player/index.html b/player/index.html
index e3cd954..6a9780b 100644
--- a/player/index.html
+++ b/player/index.html
@@ -23,23 +23,8 @@
opacity: 1;
}
- rect{
- /* opacity: .5!important;*/
- }
-
- svg{
- /*border: 1px solid red;*/
- }
-
- .rbt-black{
- font-weight: 900;
- font-family: 'Roboto', sans-serif;
- }
-
- .strokeClase1, .fillClase1{
- fill: red;
- stroke:aquamarine;
- stroke-opacity: 0;
+ .botas_loop_1,.botas_loop_2{
+ display:none
}
</style>
@@ -120,10 +105,10 @@
autoplay: true,
autoloadSegments: true,
rendererSettings: {
- progressiveLoad:true
+ progressiveLoad:false
},
//animationData: anim2
- path: 'exports/render/data.json'
+ path: 'exports/navidad/data.json'
};
anim = bodymovin.loadAnimation(animData);
diff --git a/player/js/elements/svgElements/SVGBaseElement.js b/player/js/elements/svgElements/SVGBaseElement.js
index 93702a0..e972d16 100644
--- a/player/js/elements/svgElements/SVGBaseElement.js
+++ b/player/js/elements/svgElements/SVGBaseElement.js
@@ -55,8 +55,8 @@
feCTr.appendChild(feFunc);
this.globalData.defs.appendChild(fil);
var alphaRect = document.createElementNS(svgNS,'rect');
- alphaRect.setAttribute('width',this.comp.data.w);
- alphaRect.setAttribute('height',this.comp.data.h);
+ alphaRect.setAttribute('width',this.comp.data ? this.comp.data.w : this.globalData.compSize.w);
+ alphaRect.setAttribute('height',this.comp.data ? this.comp.data.h : this.globalData.compSize.h);
alphaRect.setAttribute('x','0');
alphaRect.setAttribute('y','0');
alphaRect.setAttribute('fill','#ffffff');
diff --git a/player/js/mask.js b/player/js/mask.js
index 1fd8264..bad913b 100644
--- a/player/js/mask.js
+++ b/player/js/mask.js
@@ -31,8 +31,8 @@
if((properties[i].mode == 's' || properties[i].mode == 'i') && count == 0){
rect = document.createElementNS(svgNS, 'rect');
rect.setAttribute('fill', '#ffffff');
- rect.setAttribute('width', this.element.comp.data.w);
- rect.setAttribute('height', this.element.comp.data.h);
+ rect.setAttribute('width', this.element.comp.data ? this.element.comp.data.w : this.element.globalData.compSize.w);
+ rect.setAttribute('height', this.element.comp.data ? this.element.comp.data.h : this.element.globalData.compSize.h);
currentMasks.push(rect);
} else {
rect = null;
diff --git a/player/js/utils/bez.js b/player/js/utils/bez.js
index 69a5496..2eb3e6e 100644
--- a/player/js/utils/bez.js
+++ b/player/js/utils/bez.js
@@ -42,7 +42,6 @@
return easingFunctions[encodedFuncName];
}*/
var getBezierLength = (function(){
- var storedBezierCurves = {};
function Segment(l,p){
this.l = l;
@@ -50,10 +49,6 @@
}
return function(pt1,pt2,pt3,pt4){
- var bezierName = (pt1.join('_')+'_'+pt2.join('_')+'_'+pt3.join('_')+'_'+pt4.join('_')).replace(/\./g, 'p');
- if(storedBezierCurves[bezierName]){
- return storedBezierCurves[bezierName];
- }
var curveSegments = defaultCurveSegments;
var k;
var i, len;
@@ -83,7 +78,6 @@
lengthData.segments.push(new Segment(addedLength,perc));
}
lengthData.addedLength = addedLength;
- storedBezierCurves[bezierName] = lengthData;
return lengthData;
};
}());
diff --git a/player/js/utils/shapes/TrimModifier.js b/player/js/utils/shapes/TrimModifier.js
index 3094222..cd50cf5 100644
--- a/player/js/utils/shapes/TrimModifier.js
+++ b/player/js/utils/shapes/TrimModifier.js
@@ -88,19 +88,24 @@
shapeData.shape.paths = shapeData.last;
} else {
shapePaths = shapeData.shape.paths;
- shapeData.shape.mdf = true;
jLen = shapePaths.length;
- pathsData = [];
totalShapeLength = 0;
- for(j=0;j<jLen;j+=1){
- pathData = this.getSegmentsLength(shapePaths[j]);
- pathsData.push(pathData);
- totalShapeLength += pathData.totalLength;
+ if(!shapeData.shape.mdf && shapeData.pathsData){
+ totalShapeLength = shapeData.totalShapeLength;
+ } else {
+ pathsData = [];
+ for(j=0;j<jLen;j+=1){
+ pathData = this.getSegmentsLength(shapePaths[j]);
+ pathsData.push(pathData);
+ totalShapeLength += pathData.totalLength;
+ }
+ shapeData.totalShapeLength = totalShapeLength;
+ shapeData.pathsData = pathsData;
}
- shapeData.totalShapeLength = totalShapeLength;
- shapeData.pathsData = pathsData;
+
totalModifierLength += totalShapeLength;
}
+ shapeData.shape.mdf = true;
}
for(i=0;i<len;i+=1){
newShapes = [];