Skip to content

Commit

Permalink
version 5.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymovin committed Apr 8, 2019
1 parent 3fb030b commit 98ff0e3
Show file tree
Hide file tree
Showing 19 changed files with 197 additions and 29 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## V 5.5.1
- FIX: key expression for new json format
- IMPROVEMENT: forcing a rerender when resize is called in canvas
- ACCESSIBILITY: added title, description and aria label for text layers for svg renderer

## V 5.5.0
- IMPROVEMENT: JSON filesize reduction. Around 25 to 33% filesize reduction with this new version.
- FEATURE: Bodymovin panel with new advanced settings to reduce filesize.
Expand Down
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## V 5.5.1
- FIX: key expression for new json format
- IMPROVEMENT: forcing a rerender when resize is called in canvas
- ACCESSIBILITY: added title, description and aria label for text layers for svg renderer

## V 5.5.0
- IMPROVEMENT: JSON filesize reduction. Around 25 to 33% filesize reduction with this new version.
- FEATURE: Bodymovin panel with new advanced settings to reduce filesize.
Expand Down
Binary file modified build/extension/bodymovin.zxp
Binary file not shown.
34 changes: 29 additions & 5 deletions build/player/lottie.js
Original file line number Diff line number Diff line change
Expand Up @@ -5851,6 +5851,26 @@ function SVGRenderer(animationItem, config){
this.layers = null;
this.renderedFrame = -1;
this.svgElement = createNS('svg');
var ariaLabel = '';
if (config && config.title) {
var titleElement = createNS('title');
var titleId = createElementID();
titleElement.setAttribute('id', titleId);
titleElement.textContent = config.title;
this.svgElement.appendChild(titleElement);
ariaLabel += titleId;
}
if (config && config.description) {
var descElement = createNS('desc');
var descId = createElementID();
descElement.setAttribute('id', descId);
descElement.textContent = config.description;
this.svgElement.appendChild(descElement);
ariaLabel += ' ' + descId;
}
if (ariaLabel) {
this.svgElement.setAttribute('aria-labelledby', ariaLabel)
}
var defs = createNS( 'defs');
this.svgElement.appendChild(defs);
var maskElement = createNS('g');
Expand All @@ -5865,6 +5885,7 @@ function SVGRenderer(animationItem, config){
viewBoxSize: (config && config.viewBoxSize) || false,
className: (config && config.className) || ''
};

this.globalData = {
_mdf: false,
frameNum: -1,
Expand Down Expand Up @@ -6315,6 +6336,8 @@ CanvasRenderer.prototype.updateContainerSize = function () {
this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
this.canvasContext.closePath();
this.canvasContext.clip();

this.renderFrame(this.renderedFrame, true);
};

CanvasRenderer.prototype.destroy = function () {
Expand All @@ -6333,14 +6356,14 @@ CanvasRenderer.prototype.destroy = function () {
this.destroyed = true;
};

CanvasRenderer.prototype.renderFrame = function(num){
if((this.renderedFrame == num && this.renderConfig.clearCanvas === true) || this.destroyed || num === -1){
CanvasRenderer.prototype.renderFrame = function(num, forceRender){
if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
return;
}
this.renderedFrame = num;
this.globalData.frameNum = num - this.animationItem._isFirstFrame;
this.globalData.frameId += 1;
this.globalData._mdf = !this.renderConfig.clearCanvas;
this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
this.globalData.projectInterface.currentFrame = num;

// console.log('--------');
Expand Down Expand Up @@ -8296,6 +8319,7 @@ SVGTextElement.prototype.buildNewText = function(){
this.layerElement.setAttribute('font-style', fStyle);
this.layerElement.setAttribute('font-weight', fWeight);
}
this.layerElement.setAttribute('arial-label', documentData.t);

var letters = documentData.l || [];
var usesGlyphs = !!this.globalData.fontManager.chars;
Expand Down Expand Up @@ -12333,7 +12357,7 @@ var ExpressionManager = (function(){
};
var arr;
if(ind === data.k.length - 1 && !data.k[ind].h){
arr = data.k[ind-1].e;
arr = (data.k[ind].s || data.k[ind].s === 0) ? data.k[ind-1].s : data.k[ind].e;
}else{
arr = data.k[ind].s;
}
Expand Down Expand Up @@ -14311,7 +14335,7 @@ GroupEffect.prototype.init = function(data,element){
lottiejs.unfreeze = animationManager.unfreeze;
lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
lottiejs.__getFactory = getFactory;
lottiejs.version = '5.5.0';
lottiejs.version = '5.5.1';

function checkReady() {
if (document.readyState === "complete") {
Expand Down
2 changes: 1 addition & 1 deletion build/player/lottie.min.js

Large diffs are not rendered by default.

33 changes: 28 additions & 5 deletions build/player/lottie_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -5847,6 +5847,26 @@ function SVGRenderer(animationItem, config){
this.layers = null;
this.renderedFrame = -1;
this.svgElement = createNS('svg');
var ariaLabel = '';
if (config && config.title) {
var titleElement = createNS('title');
var titleId = createElementID();
titleElement.setAttribute('id', titleId);
titleElement.textContent = config.title;
this.svgElement.appendChild(titleElement);
ariaLabel += titleId;
}
if (config && config.description) {
var descElement = createNS('desc');
var descId = createElementID();
descElement.setAttribute('id', descId);
descElement.textContent = config.description;
this.svgElement.appendChild(descElement);
ariaLabel += ' ' + descId;
}
if (ariaLabel) {
this.svgElement.setAttribute('aria-labelledby', ariaLabel)
}
var defs = createNS( 'defs');
this.svgElement.appendChild(defs);
var maskElement = createNS('g');
Expand All @@ -5861,6 +5881,7 @@ function SVGRenderer(animationItem, config){
viewBoxSize: (config && config.viewBoxSize) || false,
className: (config && config.className) || ''
};

this.globalData = {
_mdf: false,
frameNum: -1,
Expand Down Expand Up @@ -6311,6 +6332,8 @@ CanvasRenderer.prototype.updateContainerSize = function () {
this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
this.canvasContext.closePath();
this.canvasContext.clip();

this.renderFrame(this.renderedFrame, true);
};

CanvasRenderer.prototype.destroy = function () {
Expand All @@ -6329,14 +6352,14 @@ CanvasRenderer.prototype.destroy = function () {
this.destroyed = true;
};

CanvasRenderer.prototype.renderFrame = function(num){
if((this.renderedFrame == num && this.renderConfig.clearCanvas === true) || this.destroyed || num === -1){
CanvasRenderer.prototype.renderFrame = function(num, forceRender){
if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
return;
}
this.renderedFrame = num;
this.globalData.frameNum = num - this.animationItem._isFirstFrame;
this.globalData.frameId += 1;
this.globalData._mdf = !this.renderConfig.clearCanvas;
this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
this.globalData.projectInterface.currentFrame = num;

// console.log('--------');
Expand Down Expand Up @@ -10180,7 +10203,7 @@ var ExpressionManager = (function(){
};
var arr;
if(ind === data.k.length - 1 && !data.k[ind].h){
arr = data.k[ind-1].e;
arr = (data.k[ind].s || data.k[ind].s === 0) ? data.k[ind-1].s : data.k[ind].e;
}else{
arr = data.k[ind].s;
}
Expand Down Expand Up @@ -12158,7 +12181,7 @@ GroupEffect.prototype.init = function(data,element){
lottiejs.unfreeze = animationManager.unfreeze;
lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
lottiejs.__getFactory = getFactory;
lottiejs.version = '5.5.0';
lottiejs.version = '5.5.1';

function checkReady() {
if (document.readyState === "complete") {
Expand Down
2 changes: 1 addition & 1 deletion build/player/lottie_canvas.min.js

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions build/player/lottie_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -5851,6 +5851,26 @@ function SVGRenderer(animationItem, config){
this.layers = null;
this.renderedFrame = -1;
this.svgElement = createNS('svg');
var ariaLabel = '';
if (config && config.title) {
var titleElement = createNS('title');
var titleId = createElementID();
titleElement.setAttribute('id', titleId);
titleElement.textContent = config.title;
this.svgElement.appendChild(titleElement);
ariaLabel += titleId;
}
if (config && config.description) {
var descElement = createNS('desc');
var descId = createElementID();
descElement.setAttribute('id', descId);
descElement.textContent = config.description;
this.svgElement.appendChild(descElement);
ariaLabel += ' ' + descId;
}
if (ariaLabel) {
this.svgElement.setAttribute('aria-labelledby', ariaLabel)
}
var defs = createNS( 'defs');
this.svgElement.appendChild(defs);
var maskElement = createNS('g');
Expand All @@ -5865,6 +5885,7 @@ function SVGRenderer(animationItem, config){
viewBoxSize: (config && config.viewBoxSize) || false,
className: (config && config.className) || ''
};

this.globalData = {
_mdf: false,
frameNum: -1,
Expand Down Expand Up @@ -7944,6 +7965,7 @@ SVGTextElement.prototype.buildNewText = function(){
this.layerElement.setAttribute('font-style', fStyle);
this.layerElement.setAttribute('font-weight', fWeight);
}
this.layerElement.setAttribute('arial-label', documentData.t);

var letters = documentData.l || [];
var usesGlyphs = !!this.globalData.fontManager.chars;
Expand Down Expand Up @@ -11087,7 +11109,7 @@ var ExpressionManager = (function(){
};
var arr;
if(ind === data.k.length - 1 && !data.k[ind].h){
arr = data.k[ind-1].e;
arr = (data.k[ind].s || data.k[ind].s === 0) ? data.k[ind-1].s : data.k[ind].e;
}else{
arr = data.k[ind].s;
}
Expand Down Expand Up @@ -13065,7 +13087,7 @@ GroupEffect.prototype.init = function(data,element){
lottiejs.unfreeze = animationManager.unfreeze;
lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
lottiejs.__getFactory = getFactory;
lottiejs.version = '5.5.0';
lottiejs.version = '5.5.1';

function checkReady() {
if (document.readyState === "complete") {
Expand Down
2 changes: 1 addition & 1 deletion build/player/lottie_html.min.js

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion build/player/lottie_light.js
Original file line number Diff line number Diff line change
Expand Up @@ -5851,6 +5851,26 @@ function SVGRenderer(animationItem, config){
this.layers = null;
this.renderedFrame = -1;
this.svgElement = createNS('svg');
var ariaLabel = '';
if (config && config.title) {
var titleElement = createNS('title');
var titleId = createElementID();
titleElement.setAttribute('id', titleId);
titleElement.textContent = config.title;
this.svgElement.appendChild(titleElement);
ariaLabel += titleId;
}
if (config && config.description) {
var descElement = createNS('desc');
var descId = createElementID();
descElement.setAttribute('id', descId);
descElement.textContent = config.description;
this.svgElement.appendChild(descElement);
ariaLabel += ' ' + descId;
}
if (ariaLabel) {
this.svgElement.setAttribute('aria-labelledby', ariaLabel)
}
var defs = createNS( 'defs');
this.svgElement.appendChild(defs);
var maskElement = createNS('g');
Expand All @@ -5865,6 +5885,7 @@ function SVGRenderer(animationItem, config){
viewBoxSize: (config && config.viewBoxSize) || false,
className: (config && config.className) || ''
};

this.globalData = {
_mdf: false,
frameNum: -1,
Expand Down Expand Up @@ -7647,6 +7668,7 @@ SVGTextElement.prototype.buildNewText = function(){
this.layerElement.setAttribute('font-style', fStyle);
this.layerElement.setAttribute('font-weight', fWeight);
}
this.layerElement.setAttribute('arial-label', documentData.t);

var letters = documentData.l || [];
var usesGlyphs = !!this.globalData.fontManager.chars;
Expand Down Expand Up @@ -9526,7 +9548,7 @@ function EffectsManager(){}
lottiejs.unfreeze = animationManager.unfreeze;
lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
lottiejs.__getFactory = getFactory;
lottiejs.version = '5.5.0';
lottiejs.version = '5.5.1';

function checkReady() {
if (document.readyState === "complete") {
Expand Down
2 changes: 1 addition & 1 deletion build/player/lottie_light.min.js

Large diffs are not rendered by default.

31 changes: 27 additions & 4 deletions build/player/lottie_light_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -5847,6 +5847,26 @@ function SVGRenderer(animationItem, config){
this.layers = null;
this.renderedFrame = -1;
this.svgElement = createNS('svg');
var ariaLabel = '';
if (config && config.title) {
var titleElement = createNS('title');
var titleId = createElementID();
titleElement.setAttribute('id', titleId);
titleElement.textContent = config.title;
this.svgElement.appendChild(titleElement);
ariaLabel += titleId;
}
if (config && config.description) {
var descElement = createNS('desc');
var descId = createElementID();
descElement.setAttribute('id', descId);
descElement.textContent = config.description;
this.svgElement.appendChild(descElement);
ariaLabel += ' ' + descId;
}
if (ariaLabel) {
this.svgElement.setAttribute('aria-labelledby', ariaLabel)
}
var defs = createNS( 'defs');
this.svgElement.appendChild(defs);
var maskElement = createNS('g');
Expand All @@ -5861,6 +5881,7 @@ function SVGRenderer(animationItem, config){
viewBoxSize: (config && config.viewBoxSize) || false,
className: (config && config.className) || ''
};

this.globalData = {
_mdf: false,
frameNum: -1,
Expand Down Expand Up @@ -6311,6 +6332,8 @@ CanvasRenderer.prototype.updateContainerSize = function () {
this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h);
this.canvasContext.closePath();
this.canvasContext.clip();

this.renderFrame(this.renderedFrame, true);
};

CanvasRenderer.prototype.destroy = function () {
Expand All @@ -6329,14 +6352,14 @@ CanvasRenderer.prototype.destroy = function () {
this.destroyed = true;
};

CanvasRenderer.prototype.renderFrame = function(num){
if((this.renderedFrame == num && this.renderConfig.clearCanvas === true) || this.destroyed || num === -1){
CanvasRenderer.prototype.renderFrame = function(num, forceRender){
if((this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender) || this.destroyed || num === -1){
return;
}
this.renderedFrame = num;
this.globalData.frameNum = num - this.animationItem._isFirstFrame;
this.globalData.frameId += 1;
this.globalData._mdf = !this.renderConfig.clearCanvas;
this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
this.globalData.projectInterface.currentFrame = num;

// console.log('--------');
Expand Down Expand Up @@ -9694,7 +9717,7 @@ function EffectsManager(){}
lottiejs.unfreeze = animationManager.unfreeze;
lottiejs.getRegisteredAnimations = animationManager.getRegisteredAnimations;
lottiejs.__getFactory = getFactory;
lottiejs.version = '5.5.0';
lottiejs.version = '5.5.1';

function checkReady() {
if (document.readyState === "complete") {
Expand Down
2 changes: 1 addition & 1 deletion build/player/lottie_light_canvas.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 98ff0e3

Please sign in to comment.