fix issue with text selection

This commit is contained in:
JFH
2021-11-12 17:32:54 +01:00
parent 585bd06212
commit 254f86397b
7 changed files with 14 additions and 64 deletions

View File

@@ -37,23 +37,6 @@ const supportsGoodTextCharPos_ = (function () {
}
}());
// Support for correct bbox sizing on groups with horizontal/vertical lines
const supportsHVLineContainerBBox_ = (function () {
const svgcontent = document.createElementNS(NSSVG, 'svg');
document.documentElement.append(svgcontent);
const path = document.createElementNS(NSSVG, 'path');
path.setAttribute('d', 'M0,0 10,0');
const path2 = document.createElementNS(NSSVG, 'path');
path2.setAttribute('d', 'M5,0 15,0');
const g = document.createElementNS(NSSVG, 'g');
g.append(path, path2);
svgcontent.append(g);
const bbox = g.getBBox();
svgcontent.remove();
// Webkit gives 0, FF gives 10, Opera (correctly) gives 15
return (bbox.width === 15);
}());
// Public API
/**
@@ -83,12 +66,6 @@ export const isMac = () => isMac_;
*/
export const isTouch = () => isTouch_;
/**
* @function module:browser.supportsHVLineContainerBBox
* @returns {boolean}
*/
export const supportsHVLineContainerBBox = () => supportsHVLineContainerBBox_;
/**
* @function module:browser.supportsGoodTextCharPos
* @returns {boolean}

View File

@@ -11,20 +11,7 @@ const NSSVG = 'http://www.w3.org/2000/svg';
const wAttrs = [ 'x', 'x1', 'cx', 'rx', 'width' ];
const hAttrs = [ 'y', 'y1', 'cy', 'ry', 'height' ];
const unitAttrs = [ 'r', 'radius', ...wAttrs, ...hAttrs ];
// unused
/*
const unitNumMap = {
'%': 2,
em: 3,
ex: 4,
px: 5,
cm: 6,
mm: 7,
in: 8,
pt: 9,
pc: 10
};
*/
// Container of elements.
let elementContainer_;