qauMaWeb/node_modules/.cache/babel-loader/03ef135e7378713c7970213d65d...

1 line
13 KiB
JSON
Raw Normal View History

2024-10-13 18:02:27 +08:00
{"ast":null,"code":"import \"core-js/modules/es.array.join.js\";\nimport { isAroundZero } from './helper.js';\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nvar PI2 = Math.PI * 2;\nvar degree = 180 / PI;\n\nvar SVGPathRebuilder = function () {\n function SVGPathRebuilder() {}\n\n SVGPathRebuilder.prototype.reset = function (precision) {\n this._start = true;\n this._d = [];\n this._str = '';\n this._p = Math.pow(10, precision || 4);\n };\n\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\n this._add('M', x, y);\n };\n\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\n this._add('L', x, y);\n };\n\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\n this._add('C', x, y, x2, y2, x3, y3);\n };\n\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\n this._add('Q', x, y, x2, y2);\n };\n\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n };\n\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\n var dTheta = endAngle - startAngle;\n var clockwise = !anticlockwise;\n var dThetaPositive = Math.abs(dTheta);\n var isCircle = isAroundZero(dThetaPositive - PI2) || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n var unifiedTheta = dTheta > 0 ? dTheta % PI2 : dTheta % PI2 + PI2;\n var large = false;\n\n if (isCircle) {\n large = true;\n } else if (isAroundZero(dThetaPositive)) {\n large = false;\n } else {\n large = unifiedTheta >= PI === !!clockwise;\n }\n\n var x0 = cx + rx * mathCos(startAngle);\n var y0 = cy + ry * mathSin(startAngle);\n\n if (this._start) {\n this._add('M', x0, y0);\n }\n\n var xRot = Math.round(psi * degree);\n\n if (isCircle) {\n var p = 1 / this._p;\n var dTheta_1 = (clockwise ? 1 : -1) * (PI2 - p);\n\n this._add('A', rx, ry, xRot, 1, +clockwise, cx + rx * mathCos(startAngle + dTheta_1), cy + ry * mathSin(startAngle + dTheta_1));\n\n if (p > 1e-2) {\n this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0);\n }\n } else {\n var x = cx + rx * mathCos(endAngle);\n var y = cy + ry * mathSin(endAngle);\n\n this._add('A', rx, ry, xRot, +large, +clockwise, x, y);\n }\n };\n\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\n this._add('M', x, y);\n\n this._add('l', w, 0);\n\n this._add('l', 0, h);\n\n this._add('l', -w, 0);\n\n this._add('Z');\n };\n\n SVGPathRebuilder.prototype.closePath = function () {\n if (this._d.length > 0) {\n this._add('Z');\n }\n };\n\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\n var vals = [];\n var p = this._p;\n\n for (var i = 1; i < arguments.length; i++) {\n var val = arguments[i];\n\n if (isNaN(val)) {\n this._invalid = true;\n return;\n }\n\n vals.push(Math.round(val * p) / p);\n }\n\n this._d.push(cmd + vals.join(' '));\n\n this._start = cmd === 'Z';\n };\n\n SVGPathRebuilder.prototype.generateStr = function () {\n this._str = this._invalid ? '' : this._d.join('');\n this._d = [];\n };\n\n SVGPathRebuilder.prototype.getStr = function () {\n return this._str;\n };\n\n return SVGPathRebuilder;\n}();\n\nexport default SVGPathRebuilder;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/zrender/lib/svg/SVGPathRebuilder.js"],"names":["isAroundZero","mathSin","Math","sin","mathCos","cos","PI","PI2","degree","SVGPathRebuilder","prototype","reset","precision","_start","_d","_str","_p","pow","moveTo","x","y","_add","lineTo","bezierCurveTo","x2","y2","x3","y3","quadraticCurveTo","arc","cx","cy","r","startAngle","endAngle","anticlockwise","ellipse","rx","ry","psi","dTheta","clockwise","dThetaPositive","abs","isCircle","unifiedTheta","large","x0","y0","xRot","