• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

1.0K

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
New Here ,
May 07, 2024 May 07, 2024

Copy link to clipboard

Copied

LATEST

4 years later - thanks for that!

Votes

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