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%") {
}else if(entries[1]?.replace(/([\"]+)/gm, "") === "center") {
result['transformorigin'] = origin
}
- }
+ }*/
}
obj[anim] = Object.assign({}, result)
}
var LinkeditorPreviewLinks = function(linkeditor) {
this.linkeditor = linkeditor;
this.linkData = []
+ this.links = null
this.init()
}
},
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('<div id="linkeditor-layer-links"></div>')
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) {
// 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()
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) {
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`);
let referenceCenterY0 = parseInt(link.top)
targetDiv.attr("data-origin-0-0", `${referenceCenterX0}px ${referenceCenterY0}px`);
- }
+ }*/
},
getClipPath(x,y,w,h) {