#374 slide increase issue fixed

master
agriyadev5 2021-06-10 16:16:46 +05:30
parent 5578db893e
commit a0337ebf9d
2 changed files with 25 additions and 23 deletions

View File

@ -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);
}
}
});

View File

@ -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' ],