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

Issues found in function makeResponsive

New Here ,
Nov 10, 2020 Nov 10, 2020

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]);	

 

1.2K
Translate
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
LATEST

4 years later - thanks for that!

Translate
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