masks ended
diff --git a/player/index.html b/player/index.html index 9b3d65c..30a7767 100644 --- a/player/index.html +++ b/player/index.html
@@ -36,6 +36,6 @@ <!-- endbuild --> </head> <body style="background-color:#ccc; margin: 0px;height: 100%; font-family: sans-serif;font-size: 10px"> -<div style="width:800px;height:800px;background-color:#333;display:inline-block" class="bodymovin" data-bm-path="exports/gabriel/navidad" data-bm-type="svg" data-bm-loop="true" data-bm-prerender="false"></div> +<div style="width:800px;height:800px;background-color:#333;display:inline-block" class="bodymovin" data-bm-path="exports/navidad" data-bm-type="svg" data-bm-loop="true" data-bm-prerender="false"></div> </body> </html>
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js index 47bc96b..a1484ca 100644 --- a/player/js/animation/AnimationItem.js +++ b/player/js/animation/AnimationItem.js
@@ -124,7 +124,7 @@ this.totalFrames = this.animationData.animation.totalFrames; this.frameRate = this.animationData.animation.frameRate; this.firstFrame = Math.round(this.animationData.animation.ff*this.frameRate); - /*this.firstFrame = 56; + /*this.firstFrame = 68; this.totalFrames = 1;*/ this.frameMult = this.animationData.animation.frameRate / 1000; dataManager.completeData(this.animationData);
diff --git a/player/js/elements/BaseElement.js b/player/js/elements/BaseElement.js index af3b0df..e87902d 100644 --- a/player/js/elements/BaseElement.js +++ b/player/js/elements/BaseElement.js
@@ -68,10 +68,12 @@ maskGrouper.appendChild(this.layerElement); this.globalData.defs.appendChild(maskGroup); }else{ - this.layerElement = document.createElementNS(svgNS,'mask'); - this.layerElement.setAttribute('id',this.layerId); - this.layerElement.setAttribute('mask-type','alpha'); - this.globalData.defs.appendChild(this.layerElement); + this.layerElement = document.createElementNS(svgNS,'g'); + var masker = document.createElementNS(svgNS,'mask'); + masker.setAttribute('id',this.layerId); + masker.setAttribute('mask-type','alpha'); + masker.appendChild(this.layerElement); + this.globalData.defs.appendChild(masker); } if(this.data.hasMask){ this.maskedElement = this.layerElement; @@ -106,7 +108,7 @@ if(this.data.type == 'NullLayer'){ return; } - if(this.data.inPoint - this.data.startTime <= num && this.data.outPoint - this.data.startTime >= num) + if(this.data.inPoint - this.data.startTime <= num && this.data.outPoint - this.data.startTime > num) { if(this.isVisible !== true){ this.isVisible = true;
diff --git a/player/js/mask.js b/player/js/mask.js index c053b64..a2bd9b8 100644 --- a/player/js/mask.js +++ b/player/js/mask.js
@@ -22,6 +22,7 @@ var currentMasks = []; var j, jLen; var layerId = randomString(10); + this.maskElement = document.createElementNS(svgNS, 'mask'); for (i = 0; i < len; i++) { if(properties[i].inv && !this.solidPath){ this.solidPath = this.createLayerSolidPath(); @@ -29,7 +30,7 @@ //console.log('properties[i].mode: ',properties[i].mode); - if((properties[i].mode == 'f' && i > 0) || properties[i].mode == 'n' || (properties[i].mode == 's' && i == 0) || (properties[i].mode == 'i' && i == 0) ) { + if((properties[i].mode == 'f' && count > 0) || properties[i].mode == 'n' || (properties[i].mode == 's' && count == 0) || (properties[i].mode == 'i' && count == 0) ) { continue; } @@ -91,10 +92,12 @@ MaskElement.prototype.renderFrame = function (num) { var i, len = this.data.masksProperties.length; + var count = 0; for (i = 0; i < len; i++) { - if((this.data.masksProperties[i].mode == 'f' && i > 0) || this.data.masksProperties[i].mode == 'n' || (this.data.masksProperties[i].mode == 's' && i == 0) || (this.data.masksProperties[i].mode == 'i' && i == 0)){ + if((this.data.masksProperties[i].mode == 'f' && count > 0) || this.data.masksProperties[i].mode == 'n' || (this.data.masksProperties[i].mode == 's' && count == 0) || (this.data.masksProperties[i].mode == 'i' && count == 0)){ continue; } + count += 1; this.drawPath(this.data.masksProperties[i],this.data.masksProperties[i].paths[num].pathNodes,this.storedData[i],this.data.masksProperties[i].mode); } };