From 775a0ae3bf0eca22ab5da71602f765624a08eb67 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 1 Sep 2022 20:16:28 +0200 Subject: [PATCH] wait #5420 --- js/libs/fluidbook/fluidbook.links.js | 29 +++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 429f8993..abefe144 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -664,7 +664,15 @@ FluidbookLinks.prototype = { animation.type = 'none'; } var defaultParams = {}; - var globalDefault = {x: 0, y: 0, yoyo: 0, repeatdelay: 0, repeat: 0, transformorigin: '50% 50%'}; + var globalDefault = { + x: 0, + y: 0, + yoyo: 0, + repeatdelay: 0, + repeat: 0, + transformorigin: '50% 50%', + preventflickering: 0 + }; if ($(linkElement).hasClass('textLink')) { globalDefault.transformorigin = '0 100%'; @@ -697,8 +705,13 @@ FluidbookLinks.prototype = { css.textAlign = animation.align; } if (animation.scale && ['scale', 'scalefrom', 'zoomin', 'zoomout'].indexOf(animation.type) === -1) { - css.transform = 'scale(' + animation.scale + ')'; - css.transformOrigin = animation.transformorigin; + if (animation.preventflickering) { + css.backgroundSize = '100% 100%'; + css.backgroundPosition = animation.transformorigin; + } else { + css.transform = 'scale(' + animation.scale + ')'; + css.transformOrigin = animation.transformorigin; + } } if (animation.letterspacing) { @@ -753,11 +766,17 @@ FluidbookLinks.prototype = { } else if (animation.type === 'zoomin' || animation.type === 'zoomout') { to.display = 'block'; to.visibility = 'visible'; - + animatedElement = $(linkElement).find('img,div.img'); from.scale = animation.type === 'zoomin' ? 1 : animation.scale; to.scale = animation.type === 'zoomout' ? 1 : animation.scale; - animatedElement = $(linkElement).find('img,div.img'); from.transformOrigin = to.transformOrigin = animation.transformorigin; + if (animation.preventflickering == 1) { + from.backgroundSize = from.scale * 100 + '% ' + from.scale * 100 + '%'; + to.backgroundSize = to.scale * 100 + '% ' + to.scale * 100 + '%'; + from.backgroundPosition = animation.transformorigin; + to.transformOrigin = from.transformOrigin = '50% 50%'; + to.scale = from.scale = 1; + } } else if (animation.type === 'fadein') { from.display = 'none'; to.display = 'block'; -- 2.39.5