Fixed highlight problems

This commit is contained in:
Uwe Oestermeier 2019-07-24 12:45:55 +02:00
parent ed40ffc43f
commit e72836e0f7
2 changed files with 4 additions and 27 deletions

6
dist/iwmlib.js vendored
View File

@ -10483,12 +10483,6 @@
svgGroup.insertBefore(maskImage, element); // image.nextSibling)
TweenLite.set(maskImage, { scale: 1 });
maskImage.style.mask = 'url(#' + maskId + ')';
let rect = document.createElementNS(svg, 'rect');
rect.setAttribute('width', width);
rect.setAttribute('height', height);
rect.classList.add('debugRect');
svgGroup.appendChild(rect);
}
svgGroup.appendChild(maskImage);

View File

@ -1,5 +1,4 @@
/* eslint-disable no-console */
/* global TweenLite */
let _HighlightEnabled = true
let _CircleIds = 0
@ -225,7 +224,7 @@ export default class Highlight extends Object {
image
})
let center = Highlight._calculateCenterRelativeTo(target, image)
console.log("_calculateCenterRelativeTo", center)
console.log('_calculateCenterRelativeTo', center)
TweenLite.set(maskImage, {
transformOrigin: `${center.x} ${center.y}`
})
@ -241,7 +240,7 @@ export default class Highlight extends Object {
}
static toggleHighlight(node) {
console.log("toggleHighlight", Highlight._isExpanded(node))
console.log('toggleHighlight', Highlight._isExpanded(node))
if (Highlight._isExpanded(node)) {
Highlight.closeHighlight(node)
} else {
@ -345,12 +344,6 @@ export default class Highlight extends Object {
svgGroup.insertBefore(maskImage, element) // image.nextSibling)
TweenLite.set(maskImage, { scale: 1 })
maskImage.style.mask = 'url(#' + maskId + ')'
let rect = document.createElementNS(svg, 'rect')
rect.setAttribute('width', width)
rect.setAttribute('height', height)
rect.classList.add('debugRect')
svgGroup.appendChild(rect)
}
svgGroup.appendChild(maskImage)
@ -374,18 +367,8 @@ export default class Highlight extends Object {
return target.classList.contains(Highlight.expandedClass)
}
static _setExpanded(target) {
target.classList.add(Highlight.expandedClass)
}
static _notExpanded(target) {
target.classList.remove(Highlight.expandedClass)
}
static closeHighlight(target, { animation = 0.5 } = {}) {
Highlight._notExpanded(target)
target.classList.remove(Highlight.expandedClass)
// eslint-disable-next-line no-unused-vars
let [mask, maskImage] = Highlight._getSVGMask(target)
console.log('Close Highlight', maskImage)