| CanvasRenderer.prototype.configAnimation = function (animData) { |
| if (this.animationItem.wrapper) { |
| this.animationItem.container = createTag('canvas'); |
| this.animationItem.container.style.width = '100%'; |
| this.animationItem.container.style.height = '100%'; |
| // this.animationItem.container.style.transform = 'translate3d(0,0,0)'; |
| // this.animationItem.container.style.webkitTransform = 'translate3d(0,0,0)'; |
| this.animationItem.container.style.transformOrigin = this.animationItem.container.style.mozTransformOrigin = this.animationItem.container.style.webkitTransformOrigin = this.animationItem.container.style['-webkit-transform'] = '0px 0px 0px'; |
| this.animationItem.wrapper.appendChild(this.animationItem.container); |
| this.canvasContext = this.animationItem.container.getContext('2d'); |
| if (this.renderConfig.className) { |
| this.animationItem.container.setAttribute('class', this.renderConfig.className); |
| } |
| } else { |
| this.canvasContext = this.renderConfig.context; |
| } |
| this.data = animData; |
| this.layers = animData.layers; |
| this.transformCanvas = { |
| w: animData.w, |
| h: animData.h, |
| sx: 0, |
| sy: 0, |
| tx: 0, |
| ty: 0, |
| }; |
| this.globalData.frameId = 0; |
| this.globalData.frameRate = animData.fr; |
| this.globalData.nm = animData.nm; |
| this.globalData.compSize = { |
| w: animData.w, |
| h: animData.h, |
| }; |
| this.globalData.canvasContext = this.canvasContext; |
| this.globalData.renderer = this; |
| this.globalData.isDashed = false; |
| this.globalData.progressiveLoad = this.renderConfig.progressiveLoad; |
| this.globalData.transformCanvas = this.transformCanvas; |
| this.elements = createSizedArray(animData.layers.length); |
| |
| this.updateContainerSize(); |
| }; |