#374 slide increase issue fixed
parent
5578db893e
commit
a0337ebf9d
|
@ -149,29 +149,31 @@ export default {
|
|||
let i = selElems.length;
|
||||
while (i--) {
|
||||
const elem = selElems[i];
|
||||
let xpos = 0;
|
||||
let ypos = 0;
|
||||
if (elem.points) {
|
||||
const list = elem.points;
|
||||
const len = list.numberOfItems;
|
||||
for (let i = 0; i < len; ++i) {
|
||||
const pt = list.getItem(i);
|
||||
xpos += parseFloat(pt.x);
|
||||
ypos += parseFloat(pt.y);
|
||||
if (elem.hasAttribute('edge')) {
|
||||
let xpos = 0;
|
||||
let ypos = 0;
|
||||
if (elem.points) {
|
||||
const list = elem.points;
|
||||
const len = list.numberOfItems;
|
||||
for (let i = 0; i < len; ++i) {
|
||||
const pt = list.getItem(i);
|
||||
xpos += parseFloat(pt.x);
|
||||
ypos += parseFloat(pt.y);
|
||||
}
|
||||
const cx = xpos / len;
|
||||
const cy = ypos / len;
|
||||
const edg = elem.getAttribute('edge');
|
||||
const inradius = (edg / 2) * cot(Math.PI / sides);
|
||||
const circumradius = inradius * sec(Math.PI / sides);
|
||||
let points = "";
|
||||
for (let s = 0; sides >= s; s++) {
|
||||
const angle = (2.0 * Math.PI * s) / sides;
|
||||
const x = circumradius * Math.cos(angle) + cx;
|
||||
const y = circumradius * Math.sin(angle) + cy;
|
||||
points += x + "," + y + " ";
|
||||
}
|
||||
elem.setAttribute("points", points);
|
||||
}
|
||||
const cx = xpos / len;
|
||||
const cy = ypos / len;
|
||||
const edg = elem.getAttribute('edge');
|
||||
const inradius = (edg / 2) * cot(Math.PI / sides);
|
||||
const circumradius = inradius * sec(Math.PI / sides);
|
||||
let points = "";
|
||||
for (let s = 0; sides >= s; s++) {
|
||||
const angle = (2.0 * Math.PI * s) / sides;
|
||||
const x = circumradius * Math.cos(angle) + cx;
|
||||
const y = circumradius * Math.sin(angle) + cy;
|
||||
points += x + "," + y + " ";
|
||||
}
|
||||
elem.setAttribute("points", points);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@ const svgWhiteList_ = {
|
|||
metadata: [ 'class', 'id' ],
|
||||
path: [ 'class', 'clip-path', 'clip-rule', 'd', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ],
|
||||
pattern: [ 'class', 'height', 'id', 'patternContentUnits', 'patternTransform', 'patternUnits', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xlink:href', 'y' ],
|
||||
polygon: [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'class', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'sides', 'shape' ],
|
||||
polygon: [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'class', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'sides', 'shape', 'edge' ],
|
||||
polyline: [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'se:connector' ],
|
||||
radialGradient: [ 'class', 'cx', 'cy', 'fx', 'fy', 'gradientTransform', 'gradientUnits', 'id', 'r', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'xlink:href' ],
|
||||
rect: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'width', 'x', 'y' ],
|
||||
|
|
Loading…
Reference in New Issue