Issues found in function makeResponsive

New Here ,
Nov 10, 2020 Nov 10, 2020

Copy link to clipboard

Copied

Hi,

 

the function makeResponsive have a problem, when i load two or more animations with different sizes in one page!

    an.makeResponsive = function(
        isResp,
        respDim,
        isScale,
        scaleType,
        domContainers
    ) {
        var lastW,
            lastH,
            lastS = 1;
        window.addEventListener("resize", resizeCanvas);
        resizeCanvas();
        function resizeCanvas() {
            var w = lib.properties.width, 
                h = lib.properties.height;
  [...]

 

var w = lib.properties.width,
h = lib.properties.height;

 

height and width will be overwritten from the last loaded animation-script!

the var "lib" must be passed here as a parameter in makeResponsitive.

    an.makeResponsive = function(
        *** lib, ***
        isResp,
        respDim,
        isScale,
        scaleType,
        domContainers
    ) {

 

And fix:

//Code to support hidpi screens and responsive scaling.
AdobeAn.makeResponsive(lib, true,'both',false,2,[canvas,anim_container,dom_overlay_container]);	

 

Views

42

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation