From 7e92b32b9be4c0d5715f3befe23ced1d5e0bf606 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 16 Oct 2025 18:28:38 +0200 Subject: [PATCH] wip #7785 @1:00 --- resources/linkeditor/js/linkeditor.links.js | 4 +-- .../linkeditor/js/linkeditor.previewLinks.js | 27 ++++++++++++------- resources/linkeditor/style/inc/_layers.sass | 3 +++ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index 18e33ad3a..d2b46e0a5 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -1745,7 +1745,7 @@ LinkeditorLinks.prototype = { if(entries[0] === "preventFlickering"){ result['preventflickering'] = 0 } - if(entries[0] === "transformOrigin"){ + /*if(entries[0] === "transformOrigin"){ if(entries[1]?.replace(/([\"]+)/gm, "") === "0% 50%") { result['transformorigin'] = origin0_50 }else if(entries[1]?.replace(/([\"]+)/gm, "") === "0% 100%") { @@ -1755,7 +1755,7 @@ LinkeditorLinks.prototype = { }else if(entries[1]?.replace(/([\"]+)/gm, "") === "center") { result['transformorigin'] = origin } - } + }*/ } obj[anim] = Object.assign({}, result) } diff --git a/resources/linkeditor/js/linkeditor.previewLinks.js b/resources/linkeditor/js/linkeditor.previewLinks.js index 9efb31270..cf3350e48 100644 --- a/resources/linkeditor/js/linkeditor.previewLinks.js +++ b/resources/linkeditor/js/linkeditor.previewLinks.js @@ -1,6 +1,7 @@ var LinkeditorPreviewLinks = function(linkeditor) { this.linkeditor = linkeditor; this.linkData = [] + this.links = null this.init() } @@ -18,7 +19,7 @@ LinkeditorPreviewLinks.prototype = { }, setPreview: function(isZooming = false, reset = false) { - const links = this.linkeditor.links.getLinksOfPage(this.linkeditor.currentPage) + this.links = this.linkeditor.links.getLinksOfPage(this.linkeditor.currentPage) if($('#linkeditor-layer-links').length < 1) { $("#linkeditor-zoom").prepend('') @@ -26,9 +27,13 @@ LinkeditorPreviewLinks.prototype = { this.linkeditor.links.updatePolygonLinks(); - for (let link in links) { - this.updatePreview(links[link],isZooming,reset) + for (let link in this.links) { + this.updatePreview(this.links[link],isZooming,reset) } + + setTimeout(() => { + this.setLimit(this.links) + }, 500) }, updatePreview: function(link, isZooming = false, reset = false) { @@ -44,8 +49,13 @@ LinkeditorPreviewLinks.prototype = { // Cropper les bords pour éviter que les animations de type scale etc... ne fassent sortir le calque // du fb afin d'obtenir un rendu plus proche du rendu final - const time = setTimeout(function(){ - if(link.type !== '39') { + }, + + setLimit: function(links) { + for(let k in links) { + if(links[k].type !== '39') { + let l = this.linkeditor.links.getLinkById(links[k].uid) + const { right, bottom, top } = $("#linkeditor-fluidbook")[0].getBoundingClientRect() const {width: wLink, height: hLink, right: rLink, bottom: bLink, left: lLink, top: tLink} = l[0].getBoundingClientRect() @@ -69,8 +79,7 @@ LinkeditorPreviewLinks.prototype = { l.css('clip-path',`polygon(${limitLeft}px ${limitTop}px, ${limitRight}px ${limitTop}px, ${limitRight}px ${limitBottom}px, ${limitLeft}px ${limitBottom}px)`) } - }, 500) - + } }, previewByType: function (type, isZooming = false, reset = false) { @@ -328,7 +337,7 @@ LinkeditorPreviewLinks.prototype = { setTransformOrigin(link, option) { const targetDiv = $('#linkeditor-layer-links [data-id-preview="'+link.uid+'"]'); - if(targetDiv !== undefined) { + /*if(targetDiv !== undefined) { let referenceCenterX = parseInt(link.left) + parseInt(link.width) / 2; let referenceCenterY = parseInt(link.top) + parseInt(link.height) / 2; targetDiv.attr("data-origin", `${referenceCenterX}px ${referenceCenterY}px`); @@ -341,7 +350,7 @@ LinkeditorPreviewLinks.prototype = { let referenceCenterY0 = parseInt(link.top) targetDiv.attr("data-origin-0-0", `${referenceCenterX0}px ${referenceCenterY0}px`); - } + }*/ }, getClipPath(x,y,w,h) { diff --git a/resources/linkeditor/style/inc/_layers.sass b/resources/linkeditor/style/inc/_layers.sass index 4ce410a4c..03584d83c 100644 --- a/resources/linkeditor/style/inc/_layers.sass +++ b/resources/linkeditor/style/inc/_layers.sass @@ -1,3 +1,6 @@ +#linkeditor-layer-links + overflow: hidden + #linkeditor-panel-layers font-size: 11px color: $color -- 2.39.5