define(["require", "exports", "@syncfusion/ej2-drawings", "@syncfusion/ej2-drawings"], function (require, exports, ej2_drawings_1, ej2_drawings_2) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function renderAdornerLayer(bounds, commonStyle, cavas, index, pdfViewer) {
var divElement = ej2_drawings_1.createHtmlElement('div', {
'id': pdfViewer.element.id + index + '_diagramAdornerLayer',
'style': 'width:' + bounds.width + 'px;height:' + bounds.height + 'px;' + commonStyle
});
if (!ej2_drawings_1.getDiagramElement(divElement.id)) {
var nextElement = pdfViewer.viewerBase.getElement('_pageDiv_' + index);
var pageBound = nextElement.getBoundingClientRect();
var svgAdornerSvg = createSvg(pdfViewer.element.id + index + '_diagramAdorner_svg', pageBound.width, pageBound.height);
svgAdornerSvg.setAttribute('class', 'e-adorner-layer' + index);
svgAdornerSvg.setAttribute('style', 'pointer-events:none;');
pdfViewer.adornerSvgLayer = ej2_drawings_2.createSvgElement('g', { 'id': pdfViewer.element.id + index + '_diagramAdorner' });
pdfViewer.adornerSvgLayer.setAttribute('style', ' pointer-events: all; ');
svgAdornerSvg.appendChild(pdfViewer.adornerSvgLayer);
divElement.appendChild(svgAdornerSvg);
divElement.style.width = pageBound.width + 'px';
divElement.style.height = pageBound.height + 'px';
if (nextElement) {
nextElement.insertBefore(divElement, nextElement.childNodes[0]);
}
else {
cavas.parentElement.appendChild(divElement);
}
var svgSelector = ej2_drawings_2.createSvgElement('g', { 'id': pdfViewer.element.id + index + '_SelectorElement' });
pdfViewer.adornerSvgLayer.appendChild(svgSelector);
ej2_drawings_2.setAttributeSvg(svgAdornerSvg, { style: 'pointer-events:none;' });
}
pdfViewer.viewerBase.applyElementStyles(divElement, index);
}
exports.renderAdornerLayer = renderAdornerLayer;
function createSvg(id, width, height) {
var svgObj = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
ej2_drawings_2.setAttributeSvg(svgObj, { 'id': id, 'width': width, 'height': height });
return svgObj;
}
exports.createSvg = createSvg;
});
|