//path \node_modules\@cornerstonejs\tools\dist\esm\drawingSvg
export function _setAttributesIfNecessary(attributes, svgNode) {
    // prevent off screen svg elements having their values modified
    if(Object.keys(attributes).some(key => attributes[key] === 'NaN' || attributes[key] === 'translate(NaN NaN)' || attributes[key]=="translate(NaN -17)")) return

    Object.keys(attributes).forEach((key) => {
        const currentValue = svgNode.getAttribute(key);
        const newValue = attributes[key];
        if (newValue === undefined || newValue === '') {
            svgNode.removeAttribute(key);
        }
        else if (currentValue !== newValue) {
            svgNode.setAttribute(key, newValue);
        }
    });
}
export default _setAttributesIfNecessary;
//# sourceMappingURL=_setAttributesIfNecessary.js.map