diff --git a/index.js b/index.js index ec6b851a4..81bddb29a 100644 --- a/index.js +++ b/index.js @@ -14623,7 +14623,7 @@ node: self, focus: o$1.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行 - img: true // 特殊标识强制布局即便没有style变化 + img: true // 特殊标识强制布局即便没有style变化 TODO }); } @@ -16491,8 +16491,7 @@ var isRepaint = o$1.isRepaint(lv); if (isRepaint) { - console.log(node.tagName); // zIndex变化需清空svg缓存 - + // zIndex变化需清空svg缓存 if (hasZ && renderMode === mode.SVG) { node.__cancelCacheSvg(true); } else { @@ -16842,9 +16841,11 @@ uniqueList: _uniqueList }); - _uniqueList.push(_o); + _uniqueList.forEach(function (item) { + options.uniqueList.push(item); + }); - options.uniqueList = options.uniqueList.concat(_uniqueList); + options.uniqueList.push(_o); } // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行 diff --git a/index.js.map b/index.js.map index d76d20f76..fedcd1fd8 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/node/Node.js","src/node/mode.js","src/util/painter.js","src/style/unit.js","src/math/matrix.js","src/math/geom.js","src/math/tar.js","src/math/index.js","src/util/$$type.js","src/util/util.js","src/style/transform.js","src/style/reg.js","src/style/gradient.js","src/style/border.js","src/style/font.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/style/image.js","src/style/blur.js","src/node/LineBox.js","src/node/Text.js","src/util/inject.js","src/util/Event.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/refresh/level.js","src/node/Xom.js","src/node/LineGroup.js","src/util/builder.js","src/node/Component.js","src/node/tag.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/node/Root.js","src/geom/Geom.js","src/geom/Line.js","src/geom/Polyline.js","src/geom/Polygon.js","src/geom/Sector.js","src/geom/Rect.js","src/geom/Circle.js","src/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/invalid.js","src/refresh/index.js","src/index.js"],"sourcesContent":["class Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__prev = null;\n this.__next = null;\n this.__parent = null;\n this.__root = null;\n this.__host = null;\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n }\n\n __destroy() {\n this.__isDestroyed = true;\n this.__parent = null;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n};\n","function canvasPolygon(ctx, list) {\n if(!list || !list.length) {\n return;\n }\n let n = 0;\n ctx.moveTo(list[0][0], list[0][1]);\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0], item[1]);\n n++;\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0], item[1], item[2], item[3]);\n n += 2;\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0], item[1], item[2], item[3], item[4], item[5]);\n n += 2;\n }\n }\n return n;\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let s = 'M' + list[0][0] + ',' + list[0][1];\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num) {\n ctx.moveTo(x1, y1);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0], controlA[1], controlB[0], controlB[1], x2, y2);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0], controlB[1], x2, y2);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0], controlA[1], x2, y2);\n return 2;\n }\n else {\n ctx.lineTo(x2, y2);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nconst OFFSET = Math.PI * 0.5;\n\nfunction canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure) {\n let n = 2;\n ctx.arc(cx, cy, r, begin * Math.PI / 180 - OFFSET, end * Math.PI / 180 - OFFSET);\n if(edge) {\n if(!large || !closure) {\n ctx.lineTo(cx, cy);\n n++;\n }\n ctx.lineTo(x1, y1);\n n++;\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n }\n else {\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n if(!large || !closure) {\n ctx.lineTo(cx, cy);\n n++;\n }\n ctx.lineTo(x1, y1);\n n++;\n }\n return n;\n}\n\nfunction svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure) {\n let d = closure && large\n ? ('M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z')\n : ('M' + cx + ',' + cy + 'L' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z');\n let d2;\n if(!edge || strokeWidth > 0) {\n d2 = 'M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2;\n }\n return [d, d2];\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasSector,\n svgSector,\n};\n","export default {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n};\n","// 生成3*3单位矩阵,css表达方法一维6位\nfunction identity() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n// 矩阵a*b,固定两个matrix都是长度6\nfunction multiply(a, b) {\n // 特殊情况优化\n let isPreIdA = a[0] === 1 && a[1] === 0 && a[2] === 0 && a[3] === 1;\n let isPreIdB = b[0] === 1 && b[1] === 0 && b[2] === 0 && b[3] === 1;\n let isSubIdA = a[4] === 0 && a[5] === 0;\n let isSubIdB = b[4] === 0 && b[5] === 0;\n if(isPreIdA && isSubIdA) {\n return b;\n }\n if(isPreIdB && isSubIdB) {\n return a;\n }\n if(isPreIdA && isPreIdB) {\n a = a.slice(0);\n a[4] += b[4];\n a[5] += b[5];\n return a;\n }\n else if(isPreIdA || isPreIdB) {\n let c = isPreIdA ? b.slice(0) : a.slice(0);\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n return c;\n }\n let c = [\n a[0] * b[0] + a[2] * b[1],\n a[1] * b[0] + a[3] * b[1],\n a[0] * b[2] + a[2] * b[3],\n a[1] * b[2] + a[3] * b[3],\n 0,\n 0,\n ];\n if(isSubIdA && isSubIdB) {\n }\n else if(isSubIdB) {\n c[4] = a[4];\n c[5] = a[5];\n }\n else {\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y] = point;\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n}\n\nfunction int2convolution(v) {\n let d = Math.floor(v * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n d *= 3;\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * @param m\n */\nfunction inverse(m) {\n let [a, b, c, d, e, f] = m;\n let ar = 1;\n let br = 0;\n let cr = 0;\n let dr = 1;\n let er = 0;\n let fr = 0;\n // 先检查a是否为0,强制a为1\n if(a === 0) {\n a = 1;\n c += 1;\n e += 1;\n ar = 2;\n cr = 1;\n er = 1;\n }\n // b/a=x,R2-R1*x,b为0可优化\n if(b !== 0) {\n let x = b / a;\n b = 0;\n d -= c * x;\n f -= e * x;\n br = -x;\n dr -= cr * x;\n fr -= er * x;\n }\n // R1/a,a为1可优化\n if(a !== 1) {\n a = 1;\n c /= a;\n ar /= a;\n cr /= a;\n er /= a;\n }\n // c/e=y,R1-R2*y,c为0可优化\n if(c !== 0) {\n let y = c / e;\n c = 0;\n e -= f * y;\n ar -= br * y;\n cr -= dr * y;\n er -= fr * y;\n }\n // 检查d是否为0,如果为0转成1,R2+1-R1\n if(d === 0) {\n d = 1;\n f += 1 - e;\n br += 1 - ar;\n dr += 1 - cr;\n fr += 1 - er;\n }\n // R2/d,d为1可优化\n else if(d !== 1) {\n f /= d;\n br /= d;\n dr /= d;\n fr /= d;\n d = 1;\n }\n // R1-R3*e,R2-R3*f,e/f为0可优化\n if(e !== 0) {\n er -= e;\n e = 0;\n }\n if(f !== 0) {\n fr -= f;\n f = 0;\n }\n return [ar, br, cr, dr, er, fr];\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n int2convolution,\n inverse,\n};\n","import mx from './matrix';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\n\n// 向量积\nfunction vectorProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(vectorProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y]\n ];\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { width, height, transformOrigin: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = mx.calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { width, height, transformOrigin: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - x * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n else if(arguments.length === 6) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\nexport default {\n vectorProduct,\n pointInPolygon,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n },\n angleBySide,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n};\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[4] = -sx1;\n m[5] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[4] = -tx1;\n n[5] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[3] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[2] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[3] = -m[3];\n m[5] = -m[5];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[4] = tx1;\n t[5] = ty1;\n m = matrix.multiply(t, m);\n return m;\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\n};\n","// 类型为引用防止json仿造\nconst TYPE_PL = { _: 0 };\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n TYPE_PL,\n};\n","import $$type from './$$type';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, mask, clip, filter } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n }\n else {\n res[0] = res[1] = res[2] = 0;\n }\n res[3] = 1;\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_PL\n || obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__target = nvd;\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍\n if(item.assigning) {\n item.assignCurrentStyle();\n }\n });\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n};\n\nexport default util;\n","import unit from '../style/unit';\nimport math from '../math/index';\nimport util from '../util/util';\n\nconst { PX, PERCENT } = unit;\nconst { matrix, geom } = math;\nconst { identity, calPoint, multiply } = matrix;\nconst { d2r, pointInPolygon } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === 'translateX') {\n t[4] = v;\n }\n else if(k === 'translateY') {\n t[5] = v;\n }\n else if(k === 'scaleX') {\n t[0] = v;\n }\n else if(k === 'scaleY') {\n t[3] = v;\n }\n else if(k === 'skewX') {\n v = d2r(v);\n t[2] = Math.tan(v);\n }\n else if(k === 'skewY') {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === 'rotateZ') {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n }\n else if(k === 'matrix') {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n }\n}\n\nfunction calMatrix(transform, ow, oh) {\n let list = normalize(transform, ow, oh);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n if(ox === 0 && oy === 0) {\n return m;\n }\n let t = identity();\n t[4] = ox;\n t[5] = oy;\n let res = multiply(t, m);\n let t2 = identity();\n t2[4] = -ox;\n t2[5] = -oy;\n res = multiply(res, t2);\n return res;\n}\n\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\n// 判断点是否在一个矩形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n [x1, y1] = calPoint([x1, y1], matrix);\n [x2, y2] = calPoint([x2, y2], matrix);\n [x3, y3] = calPoint([x3, y3], matrix);\n [x4, y4] = calPoint([x4, y4], matrix);\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\nfunction normalizeSingle(k, v, ow, oh) {\n if(k === 'translateX') {\n if(v.unit === PERCENT) {\n return v.value * ow * 0.01;\n }\n }\n else if(k === 'translateY') {\n if(v.unit === PERCENT) {\n return v.value * oh * 0.01;\n }\n }\n else if(k === 'matrix') {\n return v;\n }\n return v.value;\n}\n\nfunction normalize(transform, ow, oh) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item.unit === PX) {\n tfo.push(item.value);\n }\n else if(item.unit === PERCENT) {\n tfo.push(item.value * (i ? h : w) * 0.01);\n }\n });\n return tfo;\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n pointInQuadrilateral,\n};\n","export default {\n position: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","import util from '../util/util';\nimport unit from './unit';\nimport reg from './reg';\nimport geom from '../math/geom';\n\nconst { rgba2int, int2rgba, isNil } = util;\nconst { PX, PERCENT } = unit;\nconst { d2r } = geom;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /(-?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/%$/.test(data) || /px$/.test(data) || /^-?[\\d.]+$/.test(data)) {\n return {\n value: parseFloat(data),\n unit: /%/.test(data) ? PERCENT : PX,\n };\n }\n else {\n let res = {\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data],\n unit: PERCENT,\n };\n if(isNil(res.value)) {\n res.value = 50;\n }\n return res;\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length) {\n let list = [];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let c = int2rgba(item[0]);\n let p = item[1];\n if(p.unit === PERCENT) {\n list.push([c, p.value * 0.01]);\n }\n else {\n list.push([c, p.value / length]);\n }\n }\n else {\n list.push([int2rgba(item[0])]);\n }\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i + 1);\n break;\n }\n }\n for(let i = list.length - 1; i > 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i);\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或= 0; i--) {\n let item = list[i];\n let p = item[1];\n if(p > 0) {\n allBefore = false;\n }\n if(p < 1) {\n allAfter = false;\n }\n }\n if(allBefore) {\n list.splice(0, len - 1);\n list[0][1] = 0;\n }\n else if(allAfter) {\n list.splice(1);\n list[0][1] = 0;\n }\n // 部分在区间之外需复杂计算\n else {\n let first = list[0];\n let last = list[len - 1];\n // 只要2个的情况下就是首尾都落在外面\n if(len === 2) {\n if(first[1] < 0 && last[1] > 1) {\n getCsLimit(first, last, length);\n }\n }\n // 只有1个在外面的情况较为容易\n else {\n if(first[1] < 0) {\n let next = list[1];\n let c1 = rgba2int(first[0]);\n let c2 = rgba2int(next[0]);\n let c = getCsStartLimit(c1, first[1], c2, next[1], length);\n first[0] = 'rgba(' + c[0] + ',' + c[1] + ',' + c[2] + ',' + c[3] + ')';\n first[1] = 0;\n }\n if(last[1] > 1) {\n let prev = list[len - 2];\n let c1 = rgba2int(prev[0]);\n let c2 = rgba2int(last[0]);\n let c = getCsEndLimit(c1, prev[1], c2, last[1], length);\n last[0] = 'rgba(' + c[0] + ',' + c[1] + ',' + c[2] + ',' + c[3] + ')';\n last[1] = 1;\n }\n }\n }\n }\n // 防止精度计算溢出[0,1]\n list.forEach(item => {\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2) {\n // let size = 'farthest-corner';\n let cx, cy;\n if(position[0].unit === PX) {\n cx = x1 + position[0].value;\n }\n else {\n cx = x1 + position[0].value * iw * 0.01;\n }\n if(position[1].unit === PX) {\n cy = y1 + position[1].value;\n }\n else {\n cy = y1 + position[1].value * ih * 0.01;\n }\n let r;\n if(size === 'closest-side') {\n // 在边外特殊情况只有end颜色填充\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = 0;\n }\n else {\n let xl;\n let yl;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n } else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n } else {\n yl = y2 - cy;\n }\n r = Math.min(xl, yl);\n }\n }\n else if(size === 'closest-corner') {\n let xl;\n let yl;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n else if(size === 'farthest-side') {\n if(cx <= x1) {\n r = x1 - cx + iw;\n }\n else if(cx >= x2) {\n r = cx - x2 + iw;\n }\n else if(cy <= y1) {\n r = y1 - cy + ih;\n }\n else if(cx >= y2) {\n r = cy - y2 + ih;\n }\n else {\n let xl = Math.max(x2 - cx, cx - x1);\n let yl = Math.max(y2 - cy, cy - y1);\n r = Math.max(xl, yl);\n }\n }\n // 默认farthest-corner\n else {\n let xl;\n let yl;\n if(cx < x1 + iw * 0.5) {\n xl = x2 - cx;\n }\n else {\n xl = cx - x1;\n }\n if(cy < y1 + ih * 0.5) {\n yl = y2 - cy;\n }\n else {\n yl = cy - y1;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n return [r, cx, cy];\n}\n\n// 当linear-gradient的值超过[0,1]区间限制时,计算其对应区间1的值\nfunction getCsStartLimit(c1, p1, c2, p2, length) {\n let [ r1, g1, b1, a1 = 1 ] = c1;\n let [ r2, g2, b2, a2 = 1 ] = c2;\n let l1 = Math.abs(p1) * length;\n let l2 = p2 * length;\n let p = l1 / (l2 + l1);\n let r = Math.floor(r1 + (r2 - r1) * p);\n let g = Math.floor(g1 + (g2 - g1) * p);\n let b = Math.floor(b1 + (b2 - b1) * p);\n let a = a1 + (a2 - a1) * p;\n return [r, g, b, a];\n}\n\nfunction getCsEndLimit(c1, p1, c2, p2, length) {\n let [ r1, g1, b1, a1 = 1 ] = c1;\n let [ r2, g2, b2, a2 = 1 ] = c2;\n let l1 = p1 * length;\n let l2 = p2 * length;\n let p = (length - l1) / (l2 - l1);\n let r = Math.floor(r1 + (r2 - r1) * p);\n let g = Math.floor(g1 + (g2 - g1) * p);\n let b = Math.floor(b1 + (b2 - b1) * p);\n let a = a1 + (a2 - a1) * p;\n return [r, g, b, a];\n}\n\nfunction getCsLimit(first, last, length) {\n let c1 = rgba2int(first[0]);\n let c2 = rgba2int(last[0]);\n let [ r1, g1, b1, a1 = 1 ] = c1;\n let [ r2, g2, b2, a2 = 1 ] = c2;\n let l1 = Math.abs(first[1]) * length;\n let l2 = last[1] * length;\n let p = l1 / (l1 + l2);\n let r = Math.floor(r1 + (r2 - r1) * p);\n let g = Math.floor(g1 + (g2 - g1) * p);\n let b = Math.floor(b1 + (b2 - b1) * p);\n let a = a1 + (a2 - a1) * p;\n first[0] = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n first[1] = 0;\n p = (length + l1) / (l1 + l2);\n r = Math.floor(r1 + (r2 - r1) * p);\n g = Math.floor(g1 + (g2 - g1) * p);\n b = Math.floor(b1 + (b2 - b1) * p);\n a = a1 + (a2 - a1) * p;\n last[0] = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n last[1] = 1;\n}\n\nfunction parseGradient(s) {\n let gradient = reg.gradient.exec(s);\n if(gradient) {\n let o = {\n k: gradient[1],\n };\n if(o.k === 'linear') {\n let deg = /(-?[\\d.]+deg)|(to\\s+[toprighbml]+)/i.exec(gradient[2]);\n if(deg) {\n o.d = getLinearDeg(deg[0].toLowerCase());\n }\n else {\n o.d = 180;\n }\n }\n else if(o.k === 'radial') {\n o.s = gradient[2].indexOf('ellipse') > -1 ? 'ellipse' : 'circle';\n let size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]);\n if(size) {\n o.z = size[0].toLowerCase();\n }\n else {\n o.z = 'farthest-corner';\n }\n let position = /at\\s+((?:-?[\\d.]+(?:px|%)?)|(?:left|top|right|bottom|center))(?:\\s+((?:-?[\\d.]+(?:px|%)?)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [{\n value: 50,\n unit: PERCENT,\n }, {\n value: 50,\n unit: PERCENT,\n }];\n }\n }\n let v = gradient[2].match(/((#[0-9a-f]{3,6})|(rgba?\\(.+?\\)))\\s*(-?[\\d.]+(px|%))?/ig);\n o.v = v.map(item => {\n let res = /((?:#[0-9a-f]{3,6})|(?:rgba?\\(.+?\\)))\\s*(-?[\\d.]+(?:px|%))?/i.exec(item);\n let arr = [rgba2int(res[1])];\n if(res[2]) {\n arr[1] = {\n value: parseFloat(res[2]),\n };\n if(/%$/.test(res[2])) {\n arr[1].unit = PERCENT;\n }\n else {\n arr[1].unit = PX;\n }\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, cx, cy, w, h) {\n let theta = d2r(d);\n let length = Math.abs(w * Math.sin(theta)) + Math.abs(h * Math.cos(theta));\n let [x1, y1, x2, y2] = calLinearCoords(d, length * 0.5, cx, cy);\n let stop = getColorStop(v, length);\n return {\n x1,\n y1,\n x2,\n y2,\n stop,\n };\n}\n\nfunction getRadial(v, shape, size, position, x1, y1, x2, y2) {\n let w = x2 - x1;\n let h = y2 - y1;\n let [r, cx, cy] = calRadialRadius(shape, size, position, w, h, x1, y1, x2, y2);\n let stop = getColorStop(v, r * 2);\n // 超限情况等同于只显示end的bgc\n if(r <= 0) {\n let end = stop[stop.length - 1];\n end[1] = 0;\n stop = [end];\n cx = x1;\n cy = y1;\n // 肯定大于最长直径\n r = w + h;\n }\n return {\n cx,\n cy,\n r,\n stop,\n };\n}\n\nexport default {\n parseGradient,\n getLinear,\n getRadial,\n};\n","/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nimport geom from '../math/geom';\n\nconst { H } = geom;\n\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btw boderTopWidth\n * @param brw borderRightWidth\n * @param bbw borderBottomWidth\n * @param blw borderLeftWidth\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n // 先减去对应borderWidth,因为border可能比较宽,弧度只体现在外圆弧,有可能radius为0减去后为负数需判断\n btlx -= blw;\n btly -= btw;\n btrx -= brw;\n btry -= btw;\n bbrx -= brw;\n bbry -= bbw;\n bblx -= blw;\n bbly -= bbw;\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n};\n","'use strict';\n\nexport default {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n // lgr: 0.03271484375, // line-gap ratio,67/2048\n },\n // 'pingfang sc': {\n // lhr: 1.4, // (0+1060+340)/1000\n // car: 1.4, // (1060+340)/1000\n // blr: 1.06, // 1060/1000\n // },\n};\n","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'normal',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'stretch',\n textAlign: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n scaleX: 1,\n scaleY: 1,\n skewX: 0,\n skewY: 0,\n rotateZ: 0,\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(temp) {\n let match = temp.toString().match(/(-?[\\d.]+(px|%)?)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+px\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,6}/i.exec(v);\n if(c && [4, 7].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderWidthTop', 'borderWidthRight', 'borderWidthBottom', 'borderWidthLeft'],\n borderColor: ['borderColorTop', 'borderColorRight', 'borderColorBottom', 'borderColorLeft'],\n borderStyle: ['borderStyleTop', 'borderStyleRight', 'borderStyleBottom', 'borderStyleLeft'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundRepeat: ['backgroundRepeatX', 'backgroundRepeatY'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-)?repeat(-[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n this.toFull(style, 'backgroundRepeat');\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position[0];\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, Math.max(0, parseFloat(v)), 1, 0);\n }\n else if(/^[\\d.]+px$/i.test(v)) {\n parseFlex(style, 1, 1, 0);\n }\n else if(/^[\\d.]+%$/.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], arr[1], 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+%$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], 1, arr[1]);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n v = v.toString().split(/\\s+/);\n if(v.length === 1) {\n v[1] = '50%';\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[i];\n }\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n }\n};\n","const KEY_COLOR = [\n 'backgroundColor',\n 'borderBottomColor',\n 'borderLeftColor',\n 'borderRightColor',\n 'borderTopColor',\n 'color',\n];\n\nconst KEY_LENGTH = [\n 'fontSize',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'bottom',\n 'left',\n 'right',\n 'top',\n 'flexBasis',\n 'width',\n 'height',\n 'lineHeight',\n 'marginBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'strokeWidth',\n 'strokeMiterlimit',\n];\n\nconst KEY_GRADIENT = [\n 'backgroundImage',\n 'fill',\n 'stroke',\n];\n\nconst KEY_RADIUS = [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n};\n\nconst KEY_EXPAND = [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'rotateZ',\n 'skewX',\n 'skewY'\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\n\nlet o = {\n GEOM: {\n },\n IGNORE: {\n pointerEvents: true,\n },\n REPAINT: {\n transform: true,\n translateX: true,\n translateY: true,\n skewX: true,\n skewY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n color: true,\n fontStyle: true,\n strokeWidth: true,\n fill: true,\n strokeDasharray: true,\n strokeLinecap: true,\n strokeLinejoin: true,\n strokeMiterlimit: true,\n backgroundColor: true,\n backgroundImage: true,\n backgroundPositionX: true,\n backgroundPositionY: true,\n backgroundRepeat: true,\n backgroundSize: true,\n stroke: true,\n borderBottomColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomRightRadius: true,\n borderBottomLeftRadius: true,\n visibility: true,\n opacity: true,\n zIndex: true,\n filter: true,\n boxShadow: true,\n },\n MEASURE: {\n fontSize: true,\n fontWeight: true,\n fontFamily: true,\n },\n isIgnore(k) {\n return this.IGNORE.hasOwnProperty(k);\n },\n isRepaint(k) {\n return this.REPAINT.hasOwnProperty(k) || this.isGeom(k);\n },\n isMeasure(k) {\n return this.MEASURE.hasOwnProperty(k);\n },\n addGeom(tagName, ks) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k);\n });\n }\n else if(ks) {\n o.GEOM[ks] = tagName;\n }\n },\n isGeom(tagName, k) {\n return this.GEOM.hasOwnProperty(k) && this.GEOM[k] === tagName;\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(reset.DOM.hasOwnProperty(k)) {\n return true;\n }\n if(tagName.charAt(0) === '$' && reset.GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(this.GEOM.hasOwnProperty(k)) {\n return this.GEOM[k] === tagName;\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(o.MEASURE);\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n return true;\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls']);\no.addGeom('$polygon', ['points', 'controls']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport util from '../util/util';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING } = unit;\nconst { isNil, rgba2int } = util;\n\nconst DEFAULT_FONT_SIZE = 16;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\n/**\n * 通用的格式化计算数值单位的方法,百分比像素auto和纯数字,直接修改传入对象本身\n * @param obj 待计算的样式对象\n * @param k 对象的key\n * @param v 对象的value\n * @returns 格式化好的样式对象本身\n */\nfunction calUnit(obj, k, v) {\n if(v === 'auto') {\n obj[k] = {\n unit: AUTO,\n };\n }\n else if(v === 'inherit') {\n obj[k] = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PERCENT,\n };\n }\n else if(/px$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PX,\n };\n }\n else if(/deg$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: DEG,\n };\n }\n else {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: NUMBER,\n };\n }\n // border相关不能为负值\n if(k.toString().indexOf('border') === 0) {\n obj[k].value = Math.max(obj[k].value, 0);\n }\n return obj;\n}\n\nfunction compatibleTransform(k, v) {\n if(k.indexOf('scale') > -1) {\n v.unit = NUMBER;\n }\n else if(k.indexOf('translate') > -1) {\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n }\n else {\n if(v.unit === NUMBER) {\n v.unit = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式\n * @returns Object 标准化的样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n delete style.border;\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n delete style[k];\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n delete style.borderWidth;\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n delete style.borderColor;\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n delete style.borderStyle;\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n delete style.borderRadius;\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n delete style.background;\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n delete style.backgroundPosition;\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n delete style.flex;\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n delete style.margin;\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n delete style.padding;\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n console.error(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n temp = style.rotate;\n if(!isNil(temp)) {\n abbr.toFull(style, 'rotate');\n delete style.rotate;\n }\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp) {\n // 区分是渐变色还是图\n if(reg.gradient.test(temp)) {\n style.backgroundImage = gradient.parseGradient(temp);\n }\n else if(reg.img.test(temp)) {\n style.backgroundImage = reg.img.exec(temp)[2];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,6}/i.exec(temp);\n if(bgc && [4, 7].indexOf(bgc[0].length) > -1) {\n style.backgroundColor = {\n value: rgba2int(bgc[0]),\n unit: RGBA,\n };\n }\n else {\n bgc = /rgba?\\(.+\\)/i.exec(temp);\n style.backgroundColor = {\n value: rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]),\n unit: RGBA,\n };\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n if(/%$/.test(temp) || /px$/i.test(temp) || /^-?[\\d.]+$/.test(temp)) {\n calUnit(style, k, temp);\n temp = style[k];\n if(temp.unit === NUMBER) {\n temp.unit = PX;\n }\n }\n else {\n style[k] = {\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[temp],\n unit: PERCENT,\n };\n }\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n let bc = style.backgroundSize = [];\n let match = temp.toString().match(/\\b(?:(-?[\\d.]+(px|%)?)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(bc, i, item);\n if(bc[i].unit === NUMBER) {\n bc[i].unit = PX;\n }\n }\n else if(item === '0' || item === 0) {\n bc.push({\n value: 0,\n unit: PX,\n });\n }\n else if(item === 'contain' || item === 'cover') {\n bc.push({\n value: item,\n unit: STRING,\n });\n }\n else {\n bc.push({\n unit: AUTO,\n });\n }\n }\n }\n else {\n bc.push({\n unit: AUTO,\n });\n bc[1] = bc[0];\n }\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n style[k] = {\n value: rgba2int(v),\n unit: RGBA,\n };\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(arr, i, item);\n if(arr[i].unit === NUMBER) {\n arr[i].unit = PX;\n }\n }\n else {\n arr[i] = {\n value: 0,\n unit: PX,\n };\n }\n }\n style[k] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = style.transform = [];\n let match = temp.toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push(['matrix', arr]);\n }\n }\n else if({\n 'translateX': true,\n 'translateY': true,\n 'scaleX': true,\n 'scaleY': true,\n 'skewX': true,\n 'skewY': true,\n 'rotate': true,\n 'rotateZ': true,\n }.hasOwnProperty(k)) {\n if(k === 'rotate') {\n k = 'rotateZ';\n }\n let arr = calUnit([k, v], 1, v);\n compatibleTransform(k, arr[1]);\n transform.push(arr);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n let arr1 = calUnit([k + 'X', arr[0]], 1, arr[0]);\n let arr2 = calUnit([k + 'Y', arr[1]], 1, arr[1]);\n compatibleTransform(k, arr1[1]);\n compatibleTransform(k, arr2[1]);\n transform.push(arr1);\n transform.push(arr2);\n }\n });\n }\n }\n temp = style.transformOrigin;\n if(!isNil(temp)) {\n let tfo = style.transformOrigin = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(tfo, i, item);\n if(tfo[i].unit === NUMBER) {\n tfo[i].unit = PX;\n }\n }\n else {\n tfo.push({\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n unit: PERCENT,\n });\n // 不规范的写法变默认值50%\n if(isNil(tfo[i].value)) {\n tfo[i].value = 50;\n }\n }\n }\n }\n else {\n tfo.push({\n value: 50,\n unit: PERCENT,\n });\n tfo[1] = tfo[0];\n }\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n if(k === 'rotate') {\n k = 'rotateZ';\n style.rotateZ = style.rotate;\n delete style.rotate;\n }\n // 没有单位或默认值处理单位\n v = style[k];\n compatibleTransform(k, v);\n });\n temp = style.opacity;\n if(temp) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n style.opacity = temp;\n }\n else {\n style.opacity = 1;\n }\n }\n temp = style.zIndex;\n if(temp) {\n style.zIndex = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n 'flexBasis',\n 'strokeWidth',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n v = style[k];\n // 无单位视为px\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n });\n temp = style.color;\n if(temp) {\n if(temp === 'inherit') {\n style.color = {\n unit: INHERIT,\n };\n }\n else {\n style.color = {\n value: rgba2int(temp),\n unit: RGBA,\n };\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.fontSize = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(temp)) {\n let v = Math.max(0, parseFloat(temp));\n if(v) {\n style.fontSize = {\n value: v,\n unit: PERCENT,\n };\n }\n else {\n style.fontSize = {\n value: DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n else {\n style.fontSize = {\n value: Math.max(0, parseFloat(temp)) || DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n temp = style.fontWeight;\n if(temp || temp === 0) {\n if(temp === 'bold') {\n style.fontWeight = {\n value: 700,\n unit: NUMBER,\n };\n }\n else if(temp === 'normal') {\n style.fontWeight = {\n value: 400,\n unit: NUMBER,\n };\n }\n else if(temp === 'lighter') {\n style.fontWeight = {\n value: 200,\n unit: NUMBER,\n };\n }\n else if(temp === 'inherit') {\n style.fontWeight = {\n unit: INHERIT,\n };\n }\n else {\n style.fontWeight = {\n value: Math.max(0, parseInt(temp)) || 400,\n unit: NUMBER,\n };\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n style.fontStyle = {\n unit: INHERIT,\n };\n }\n else {\n style.fontStyle = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n style.fontFamily = {\n unit: INHERIT,\n };\n }\n else {\n style.fontFamily = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n style.textAlign = {\n unit: INHERIT,\n };\n }\n else {\n style.textAlign = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.lineHeight;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.lineHeight = {\n unit: INHERIT,\n };\n }\n else if(temp === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/px$/i.test(temp)) {\n style.lineHeight = {\n value: parseFloat(temp),\n unit: PX,\n };\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n else {\n style.lineHeight = {\n value: n,\n unit: NUMBER,\n };\n }\n }\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n style.strokeDasharray = match;\n }\n else {\n style.strokeDasharray = [];\n }\n }\n // fill和stroke为渐变时特殊处理\n temp = style.fill;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.fill = gradient.parseGradient(temp);\n }\n else {\n style.fill = rgba2int(temp);\n }\n }\n temp = style.stroke;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.stroke = gradient.parseGradient(temp);\n }\n else {\n style.stroke = rgba2int(temp);\n }\n }\n temp = style.filter;\n if(temp) {\n style.filter = [];\n let blur = /\\bblur\\s*\\(\\s*([\\d.]+)\\s*(?:px)?\\s*\\)/i.exec(temp);\n if(blur) {\n let v = parseFloat(blur[1]) || 0;\n if(v) {\n style.filter.push(['blur', v]);\n }\n }\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n style.visibility = {\n unit: INHERIT,\n };\n }\n else {\n style.visibility = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n style.pointerEvents = {\n unit: INHERIT,\n };\n }\n else {\n style.pointerEvents = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.boxShadow;\n if(temp) {\n style.boxShadow = [];\n let match = temp.match(/(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?\\s*)?(-?[\\d.]+(px)?\\s*)?(((transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n match.forEach(item => {\n let boxShadow = /(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?\\s*)?(-?[\\d.]+(?:px)?\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,6})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n let res = [boxShadow[1], boxShadow[2], boxShadow[3] || 0, boxShadow[4] || 0, boxShadow[5] || '#000', boxShadow[6] || 'outset'];\n for(let i = 0; i < 4; i++) {\n calUnit(res, i, res[i]);\n // x/y可以负,blur和spread不行,没有继承且只有px无需保存单位\n if(i > 1 && res[i].value < 0) {\n res[i] = 0;\n }\n if(res[i].unit === NUMBER) {\n res[i] = res[i].value;\n }\n }\n res[4] = rgba2int(res[4]);\n style.boxShadow.push(res);\n }\n });\n }\n return style;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let parentComputedStyle = !isHost && parent.computedStyle;\n change.MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n if(v.unit === INHERIT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v.unit === PERCENT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : (parentComputedStyle[k] * v.value * 0.01);\n }\n else {\n computedStyle[k] = v.value;\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let { textAlign, lineHeight } = currentStyle;\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ].forEach(k => {\n // border-width不支持百分比\n computedStyle[k] = currentStyle[k].unit === PX ? Math.max(0, currentStyle[k].value) : 0;\n });\n [\n 'position',\n 'display',\n 'flexDirection',\n 'justifyContent',\n 'alignItems',\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(textAlign.unit === INHERIT) {\n computedStyle.textAlign = isRoot ? 'left' : parentComputedStyle.textAlign;\n }\n else {\n computedStyle.textAlign = isRoot ? 'left' : textAlign.value;\n }\n if(lineHeight.unit === INHERIT) {\n computedStyle.lineHeight = isRoot ? calNormalLineHeight(computedStyle) : parentComputedStyle.lineHeight;\n }\n // 防止为0\n else if(lineHeight.unit === PX) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight.unit === NUMBER) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) * computedStyle.fontSize || calNormalLineHeight(computedStyle);\n }\n // normal\n else {\n computedStyle.lineHeight = calNormalLineHeight(computedStyle);\n }\n}\n\nfunction setFontStyle(style) {\n let { fontStyle, fontWeight, fontSize, fontFamily } = style;\n return (fontStyle || '') + ' ' + (fontWeight || '') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (fontFamily || '');\n}\n\nfunction getBaseLine(style) {\n let normal = style.fontSize * font.arial.lhr;\n return (style.lineHeight - normal) * 0.5 + style.fontSize * font.arial.blr;\n}\n\nfunction calNormalLineHeight(computedStyle) {\n return computedStyle.fontSize * font.arial.lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style.unit === AUTO) {\n if(k === 'width') {\n parent = parent.parent;\n }\n else {\n break;\n }\n }\n else if(style.unit === PX) {\n return n * style.value;\n }\n else if(style.unit === PERCENT) {\n n *= style.value * 0.01;\n parent = parent.parent;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v.value, parent, 'width');\n }\n else {\n v = calRelativePercent(v.value, parent, 'height');\n }\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n v = v.value * size * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === 'transform') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n if(oa === 'matrix') {\n if(!util.equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n else if(!util.equal(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === 'filter') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!util.equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === 'transformOrigin' || k === 'backgroundSize') {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a.value === b.value && a.unit === b.unit;\n }\n if(k === 'boxShadow') {\n return util.equalArr(a, b);\n }\n if(RADIUS_HASH.hasOwnProperty(k)) {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a.unit === b.unit && util.equalArr(a.value, b.value);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1].value !== bi[1].value || ai[1].unit !== bi[1].unit) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(change.isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return util.equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle.position;\n return position === 'relative' || position === 'absolute';\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n};\n","import unit from './unit';\nimport transform from './transform';\n\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n ['scaleX', {\n value: targetWidth / imgWidth,\n unit: NUMBER,\n }],\n ['scaleY', {\n value: targetHeight / imgHeight,\n unit: NUMBER,\n }]\n ];\n let tfo = transform.calOrigin([\n {\n value: 0,\n unit: PERCENT,\n },\n {\n value: 0,\n unit: PERCENT,\n }\n ], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","const VERTEX = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying vec2 vTextureCoord;\nuniform mat3 projectionMatrix;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}`;\n\nconst FRAGMENT = `\n#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}`;\n\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if (!program) {\n console.error('Failed to create program');\n return false;\n }\n\n gl.useProgram(program);\n gl.program = program;\n\n return true;\n}\n\nfunction createProgram(gl, vshader, fshader) {\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if (!vertexShader || !fragmentShader) {\n return null;\n }\n\n let program = gl.createProgram();\n if (!program) {\n return null;\n }\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if (!linked) {\n let error = gl.getProgramInfoLog(program);\n console.error('Failed to link program: ' + error);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n return null;\n }\n return program;\n}\n\nfunction loadShader(gl, type, source) {\n let shader = gl.createShader(type);\n if (shader == null) {\n console.error('unable to create shader');\n return null;\n }\n\n gl.shaderSource(shader, source);\n\n gl.compileShader(shader);\n\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!compiled) {\n let error = gl.getShaderInfoLog(shader);\n console.error('Failed to compile shader: ' + error);\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}\n\nfunction initVertexBuffers(gl) {\n let vertices = new Float32Array([\n -1, 1, 0.0, 1.0,\n -1, -1, 0.0, 0.0,\n 1, 1, 1.0, 1.0,\n 1, -1, 1.0, 0.0\n ]);\n let vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n let FSIZE = Float32Array.BYTES_PER_ELEMENT;\n let aPosition = gl.getAttribLocation(gl.program, 'aVertexPosition');\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, FSIZE * 4, 0);\n gl.enableVertexAttribArray(aPosition);\n let aTexCoord = gl.getAttribLocation(gl.program, 'aTextureCoord');\n gl.vertexAttribPointer(aTexCoord, 2, gl.FLOAT, false, FSIZE * 4, FSIZE * 2);\n\n let projectionMatrix = gl.getUniformLocation(gl.program, 'projectionMatrix');\n gl.uniformMatrix3fv(projectionMatrix, false, new Float32Array(\n [ 1, 0, 0,\n 0, 1, 0,\n 0, 0, 1 ]));\n gl.enableVertexAttribArray(aTexCoord);\n return {\n aPosition,\n aTexCoord,\n };\n}\n\nfunction initLocation(gl) {\n let uSampler = gl.getUniformLocation(gl.program, 'uSampler');\n let uOffset = gl.getUniformLocation(gl.program, 'uOffset');\n let uClamp = gl.getUniformLocation(gl.program, 'filterClamp');\n return {\n uSampler,\n uOffset,\n uClamp,\n };\n}\n\nfunction createAndSetupTexture(gl) {\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // 设置材质,这样我们可以对任意大小的图像进行像素操作\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n return texture;\n}\n\nclass KawaseBlurFilter {\n constructor(webgl, blur = 1, quality = 4) {\n this.webgl = webgl;\n let gl = this.gl = webgl.ctx;\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n initShaders(gl, VERTEX, FRAGMENT);\n this.vertexLocations = initVertexBuffers(gl);\n this.textureLocations = initLocation(gl);\n this._pixelSize = { x: 0, y: 0 };\n this.pixelSize = 1;\n this._kernels = null;\n this._blur = blur;\n this.quality = quality;\n // 创建两个纹理绑定到帧缓冲\n this.textures = [];\n this.framebuffers = [];\n }\n\n initBuffers(gl, width, height) {\n for (let i = 0; i < 2; i++) {\n let texture = createAndSetupTexture(gl);\n this.textures.push(texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n // 创建一个帧缓冲\n let fbo = gl.createFramebuffer();\n this.framebuffers.push(fbo);\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n // 绑定纹理到帧缓冲\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n }\n }\n\n draw(image, uOffsetArray, clear) {\n let { uOffset, uClamp } = this.textureLocations;\n let { gl } = this;\n gl.uniform2f(uOffset, uOffsetArray[0], uOffsetArray[1]);\n gl.viewport(0, 0, image.width, image.height);\n gl.uniform4f(uClamp, 0, 0, image.width, image.height);\n if (clear) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n apply(target, width, height) {\n let { gl } = this;\n this.initBuffers(gl, width, height);\n let { uSampler } = this.textureLocations;\n gl.uniform1i(uSampler, 0);\n let originalImageTexture = createAndSetupTexture(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, target.canvas);\n\n let uvX = this._pixelSize.x / width;\n let uvY = this._pixelSize.y / height;\n let offset;\n let last = this._quality - 1;\n // 从原始图像开始\n gl.bindTexture(gl.TEXTURE_2D, originalImageTexture);\n for (let i = 0; i < last; i++) {\n offset = this._kernels[i] + 0.5;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffers[i % 2]);\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, false);\n gl.bindTexture(gl.TEXTURE_2D, this.textures[i % 2]);\n }\n offset = this._kernels[last] + 0.5;\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, true);\n this.webgl.draw();\n target.ctx.clearRect(0, 0, width, height);\n target.ctx.drawImage(gl.canvas, 0, 0);\n target.draw();\n return this;\n }\n\n /**\n * Auto generate kernels by blur & quality\n * @private\n */\n _generateKernels() {\n let blur = this._blur;\n let quality = this._quality;\n let kernels = [ blur ];\n\n if (blur > 0) {\n let k = blur;\n let step = blur / quality;\n\n for (let i = 1; i < quality; i++) {\n k -= step;\n kernels.push(k);\n }\n }\n\n this._kernels = kernels;\n }\n\n /**\n * The kernel size of the blur filter, for advanced usage.\n *\n * @member {number[]}\n * @default [0]\n */\n get kernels() {\n return this._kernels;\n }\n\n set kernels(value) {\n if (Array.isArray(value) && value.length > 0) {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max.apply(Math, value);\n } else {\n // if value is invalid , set default value\n this._kernels = [ 0 ];\n this._quality = 1;\n }\n }\n\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n *\n * @member {PIXI.Point|number[]}\n * @default [1, 1]\n */\n set pixelSize(value) {\n if (typeof value === 'number') {\n this._pixelSize.x = value;\n this._pixelSize.y = value;\n } else if (Array.isArray(value)) {\n this._pixelSize.x = value[0];\n this._pixelSize.y = value[1];\n } else {\n // if value is invalid , set default value\n this._pixelSize.x = 1;\n this._pixelSize.y = 1;\n }\n }\n\n get pixelSize() {\n return this._pixelSize;\n }\n\n /**\n * The quality of the filter, integer greater than `1`.\n *\n * @member {number}\n * @default 3\n */\n get quality() {\n return this._quality;\n }\n\n set quality(value) {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n }\n\n /**\n * The amount of blur, value greater than `0`.\n *\n * @member {number}\n * @default 4\n */\n get blur() {\n return this._blur;\n }\n\n set blur(value) {\n this._blur = value;\n this._generateKernels();\n }\n\n clear() {\n let gl = this.gl;\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n}\n\nfunction gaussBlur(target, webgl, blur, width, height) {\n return new KawaseBlurFilter(webgl, blur).apply(target, width, height);\n}\n\nexport default {\n gaussBlur,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass LineBox {\n constructor(parent, x, y, w, content) {\n this.__parent = parent;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__content = content;\n this.__virtualDom = {};\n }\n\n render(renderMode, ctx, computedStyle, cacheStyle) {\n let { content, x, y, parent } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox;\n y += oy;\n if(renderMode === mode.CANVAS) {\n ctx.fillText(content, x, y);\n }\n else if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props: [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle.color],\n ['font-family', computedStyle.fontFamily],\n ['font-weight', computedStyle.fontWeight],\n ['font-style', computedStyle.fontStyle],\n ['font-size', computedStyle.fontSize + 'px']\n ],\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return css.getBaseLine(this.parent.computedStyle);\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n}\n\nexport default LineBox;\n","import Node from './Node';\nimport LineBox from './LineBox';\nimport mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__lineBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n static CHAR_WIDTH_CACHE = {};\n static MEASURE_TEXT = {\n list: [],\n data: {},\n };\n\n // 预先计算每个字的宽度\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n if(renderMode === mode.CANVAS) {\n ctx.font = css.setFontStyle(computedStyle);\n }\n let key = computedStyle.fontSize + ',' + computedStyle.fontFamily;\n let wait = Text.MEASURE_TEXT.data[key] = Text.MEASURE_TEXT.data[key] || {\n key,\n style: computedStyle,\n hash: {},\n s: [],\n };\n let cache = Text.CHAR_WIDTH_CACHE[key] = Text.CHAR_WIDTH_CACHE[key] || {};\n let sum = 0;\n let needMeasure = false;\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n Text.MEASURE_TEXT.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, computedStyle, charWidthList } = this;\n let key = computedStyle.fontSize + ',' + computedStyle.fontFamily;\n let cache = Text.CHAR_WIDTH_CACHE[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n __layout(data, isVirtual) {\n let { x, y, w } = data;\n this.__x = x;\n this.__y = y;\n let { isDestroyed, content, computedStyle, lineBoxes, charWidthList } = this;\n if(isDestroyed || computedStyle.display === 'none') {\n return;\n }\n this.__ox = this.__oy = 0;\n lineBoxes.splice(0);\n // 顺序尝试分割字符串为lineBox,形成多行\n let begin = 0;\n let i = 0;\n let count = 0;\n let length = content.length;\n let maxW = 0;\n while(i < length) {\n count += charWidthList[i];\n if(count === w) {\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, i + 1));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n begin = i + 1;\n i = begin;\n count = 0;\n }\n else if(count > w) {\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行\n if(i === begin) {\n i = begin + 1;\n width = count;\n }\n else {\n width = count - charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, width, content.slice(begin, i));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, width);\n y += computedStyle.lineHeight;\n begin = i;\n count = 0;\n }\n else {\n i++;\n }\n }\n // 最后一行,只有一行未满时也进这里\n if(begin < length && begin < i) {\n count = 0;\n for(i = begin; i < length; i++) {\n count += charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, length));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n }\n this.__width = maxW;\n this.__height = y - data.y;\n // flex/abs前置计算无需真正布局\n if(!isVirtual) {\n let { textAlign } = computedStyle;\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxes.forEach(lineBox => {\n let diff = this.__width - lineBox.width;\n if(diff > 0) {\n lineBox.__offsetX(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n }\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n }\n\n __tryLayInline(w) {\n return w - this.textWidth;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\n }\n\n render(renderMode, ctx) {\n if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n let { isDestroyed, computedStyle, lineBoxes, cacheStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') {\n return;\n }\n if(renderMode === mode.CANVAS) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle.color;\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n }\n lineBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = lineBoxes.map(lineBox => lineBox.virtualDom);\n }\n }\n\n deepScan(cb) {\n cb(this);\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get lineBoxes() {\n return this.__lineBoxes;\n }\n\n get charWidthList() {\n return this.__charWidthList;\n }\n\n get charWidth() {\n return this.__charWidth;\n }\n\n get textWidth() {\n return this.__textWidth;\n }\n\n get baseLine() {\n let { lineBoxes } = this;\n if(!lineBoxes.length) {\n return 0;\n }\n let last = lineBoxes[lineBoxes.length - 1];\n return last.y - this.y + last.baseLine;\n }\n\n get currentStyle() {\n return this.parent.currentStyle;\n }\n\n get computedStyle() {\n return this.parent.computedStyle;\n }\n\n get cacheStyle() {\n return this.parent.__cacheStyle;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import Text from '../node/Text';\rimport util from './util';\r\rconst SPF = 1000 / 60;\r\rconst CANVAS = {};\rconst WEBGL = {};\r\rfunction cacheCanvas(key, width, height) {\r let o;\r if(!CANVAS[key]) {\r o = CANVAS[key] = document.createElement('canvas');\r }\r else {\r o = CANVAS[key];\r }\r o.setAttribute('width', width);\r o.setAttribute('height', height);\r o.style.width = width + 'px';\r o.style.height = height + 'px';\r return {\r canvas: o,\r ctx: o.getContext('2d'),\r draw() {\r // 空函数,仅对小程序提供hook特殊处理,flush缓冲\r },\r };\r}\r\rfunction cacheWebgl(key, width, height) {\r let o;\r if(!WEBGL[key]) {\r o = WEBGL[key] = document.createElement('canvas');\r }\r else {\r o = WEBGL[key];\r }\r o.setAttribute('width', width);\r o.setAttribute('height', height);\r o.style.width = width + 'px';\r o.style.height = height + 'px';\r return {\r canvas: o,\r ctx: o.getContext('webgl') || o.getContext('experimental-webgl'),\r draw() {\r // 空函数,仅对小程序提供hook特殊处理,flush缓冲\r },\r };\r}\r\rconst IMG = {};\rconst INIT = 0;\rconst LOADING = 1;\rconst LOADED = 2;\r\rlet inject = {\r measureText(cb) {\r let { list, data } = Text.MEASURE_TEXT;\r let html = '';\r let keys = [];\r let chars = [];\r Object.keys(data).forEach(i => {\r let { key, style, s } = data[i];\r if(s) {\r let inline = `position:absolute;font-family:${style.fontFamily};font-size:${style.fontSize}px;font-weight:${style.fontWeight}`;\r for(let j = 0, len = s.length; j < len; j++) {\r keys.push(key);\r let char = s.charAt(j);\r chars.push(char);\r html += `${char.replace(/`;\r }\r }\r });\r if(!html) {\r cb();\r return;\r }\r let div = document.createElement('div');\r div.style.position = 'absolute';\r div.style.left = '99999px';\r div.style.top = '-99999px';\r div.style.visibility = 'hidden';\r document.body.appendChild(div);\r div.innerHTML = html;\r let cns = div.childNodes;\r let { CHAR_WIDTH_CACHE, MEASURE_TEXT } = Text;\r for(let i = 0, len = cns.length; i < len; i++) {\r let node = cns[i];\r let key = keys[i];\r let char = chars[i];\r // clientWidth只返回ceil整数,精度必须用getComputedStyle\r let css = window.getComputedStyle(node, null);\r CHAR_WIDTH_CACHE[key][char] = parseFloat(css.width);\r }\r list.forEach(text => text.__measureCb());\r cb();\r MEASURE_TEXT.list = [];\r MEASURE_TEXT.data = {};\r document.body.removeChild(div);\r },\r IMG,\r INIT,\r LOADED,\r LOADING,\r measureImg(url, cb) {\r let cache = IMG[url] = IMG[url] || {\r state: INIT,\r task: [],\r };\r if(cache.state === LOADED) {\r cb(cache);\r }\r else if(cache.state === LOADING) {\r cache.task.push(cb);\r }\r else {\r cache.state = LOADING;\r cache.task.push(cb);\r let img = new Image();\r img.onload = function() {\r cache.state = LOADED;\r cache.success = true;\r cache.width = img.width;\r cache.height = img.height;\r cache.source = img;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r img.onerror = function() {\r cache.state = LOADED;\r cache.success = false;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r if(url.substr(0, 5) !== 'data:') {\r let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\r if(host) {\r if(location.hostname !== host[1]) {\r img.crossOrigin = 'anonymous';\r }\r }\r }\r img.src = url;\r }\r },\r warn(s) {\r console.warn(s);\r },\r requestAnimationFrame(cb) {\r let res;\r if(typeof requestAnimationFrame !== 'undefined') {\r inject.requestAnimationFrame = requestAnimationFrame.bind(window);\r res = requestAnimationFrame(cb);\r }\r else {\r res = setTimeout(cb, SPF);\r inject.requestAnimationFrame = function(cb) {\r return setTimeout(cb, SPF);\r };\r }\r return res;\r },\r cancelAnimationFrame(id) {\r let res;\r if(typeof cancelAnimationFrame !== 'undefined') {\r inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\r res = cancelAnimationFrame(id);\r }\r else {\r res = clearTimeout(id);\r inject.cancelAnimationFrame = function(id) {\r return clearTimeout(id);\r };\r }\r return res;\r },\r now() {\r if(typeof performance !== 'undefined') {\r inject.now = performance.now.bind(performance);\r return Math.floor(performance.now());\r }\r inject.now = Date.now.bind(Date);\r return Date.now();\r },\r getCacheCanvas(width, height, key = '__$$cache$$__') {\r return cacheCanvas(key, width, height);\r },\r getCacheWebgl(width, height, key = '__$$cache$$__') {\r return cacheWebgl(key, width, height);\r },\r isDom(o) {\r if(o) {\r if(util.isString(o)) {\r return true;\r }\r if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\r return true;\r }\r if(util.isFunction(o.getElementsByTagName)) {\r return true;\r }\r }\r return false;\r },\r};\r\rexport default inject;\r","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n on(id, handle) {\n if(!handle) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else if(handle) {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction, isObject } = util;\n\nfunction traversal(list, diff, step) {\n if(step === 'before') {\n list.forEach(item => {\n if(isObject(item) && isFunction(item.before)) {\n item.before(diff);\n }\n });\n }\n else if(step === 'after') {\n list.forEach(item => {\n if(isObject(item) && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || !task.length) {\n return;\n }\n let now = self.__now = inject.now();\n let diff = now - last;\n diff = Math.max(diff, 0);\n // let delta = diff * 0.06; // 比例是除以1/60s,等同于*0.06\n last = now;\n // 优先动画计算\n let clone = task.slice(0);\n traversal(clone, diff, 'before');\n // 执行动画造成的刷新并清空,在root的refreshTask回调中可能被清空,因为task已经刷新过了\n self.__hookTask.splice(0).forEach(item => item());\n // 普通的before/after\n traversal(clone, diff, 'after');\n // 还有则继续,没有则停止节省性能\n if(task.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n if(!task.length) {\n this.__init();\n }\n task.push(handle);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n let item = task[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === handle || item.__karasFramecb === handle) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? diff => {\n handle(diff);\n this.offFrame(cb);\n } : {\n before: handle.before,\n after: diff => {\n handle.after && handle.after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n};\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\n\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER } = unit;\nconst { isNil, isFunction, isNumber, isObject, clone, equalArr } = util;\nconst { linear } = easing;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item.style;\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 空的过滤掉\n if(!isNil(v) && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(change.GEOM.hasOwnProperty(k)) {\n style[k] = target.currentProps[k];\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === 'transform') {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [['matrix', m]];\n }\n else if(v.unit === INHERIT) {\n if(k === 'color') {\n style[k] = {\n value: util.rgba2int(computedStyle[k]),\n unit: RGBA,\n };\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = {\n value: computedStyle[k],\n unit: PX,\n };\n }\n else if(k === 'fontWeight') {\n style[k] = {\n value: computedStyle[k],\n unit: NUMBER,\n };\n }\n else if(k === 'fontStyle' || k === 'fontFamily' || k === 'textAlign') {\n style[k] = {\n value: computedStyle[k],\n unit: STRING,\n };\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param frameStyle\n * @param animation\n * @param root\n */\nfunction genBeforeRefresh(frameStyle, animation, root) {\n root.__addUpdate({\n node: animation.target,\n style: frameStyle,\n });\n animation.__style = frameStyle;\n animation.__assigning = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\nfunction gen(frameStyle, animation, root) {\n root.__addUpdate({\n node: animation.target,\n style: frameStyle,\n });\n animation.__style = frameStyle;\n animation.__assigning = true;\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n style = css.normalize(style);\n return {\n style,\n time: offset * duration,\n easing: easing || es,\n transition: [],\n };\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target) {\n let res = {\n k,\n };\n let p = prev[k];\n let n = next[k];\n if(k === 'transform') {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = [1, 0, 0, 1, 0, 0];\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = [1, 0, 0, 1, 0, 0];\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res.v = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n ];\n return res;\n }\n else if(k === 'filter') {\n // 目前只有1个blur,可以简单处理\n if(!p || !p.length) {\n res.v = n[0][1];\n }\n else if(!n || !n.length) {\n res.v = -p[0][1];\n }\n else {\n res.v = n[0][1] - p[0][1];\n }\n }\n else if(k === 'transformOrigin') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY') {\n if(p.unit === n.unit && [PX, PERCENT].indexOf(p.unit) > -1) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'boxShadow') {\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res.v.push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p.unit === n.unit) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'backgroundSize') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit && [PX, PERCENT].indexOf(pi.unit) > -1) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else {\n return;\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n if(p.k !== n.k) {\n return;\n }\n // 渐变\n else if(p.k === 'linear' || p.k === 'radial') {\n let pv = p.v;\n let nv = n.v;\n if(equalArr(pv, nv)) {\n return;\n }\n res.v = [];\n let { innerWidth } = target;\n let eq;\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n eq = equalArr(t, [0, 0, 0, 0]);\n if(a[1] && b[1]) {\n if(a[1].unit === b[1].unit) {\n t.push(b[1].value - a[1].value);\n }\n else if(a[1].unit === PX && b[1].unit === PERCENT) {\n t.push(b[1].value * innerWidth * 0.01 - a[1].value);\n }\n else if(a[1].unit === PERCENT && b[1].unit === PX) {\n t.push(b[1].value * 100 / innerWidth - a[1].value);\n }\n if(eq) {\n eq = t[4] === 0;\n }\n }\n else if(a[1] || b[1]) {\n eq = false;\n }\n res.v.push(t);\n }\n // 线性渐变有角度差值变化\n if(p.k === 'linear') {\n let v = n.d - p.d;\n if(eq && v === 0) {\n return;\n }\n res.d = v;\n }\n // 径向渐变的位置\n else {\n res.p = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp.unit === np.unit) {\n res.p.push(np.value - pp.value);\n }\n else if(pp.unit === PX && np.unit === PERCENT) {\n let v = np.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n else if(pp.unit === PERCENT && np.unit === PX) {\n let v = np.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n }\n if(eq && equalArr(res.p, [0, 0])) {\n return;\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, p)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n.value;\n p = p.value;\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0].value === p[0].value && n[0].unit === p[0].unit\n && n[1].value === p[1].value && n[1].unit === p[1].unit) {\n return;\n }\n res.v = [];\n for(let i = 0; i < 2; i++) {\n if(n[i].unit === p[i].unit) {\n res.v.push(n[i].value - p[i].value);\n }\n else if(p[i].unit === PX && n[i].unit === PERCENT) {\n res.v.push(n[i].value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else if(p[i].unit === PERCENT && n[i].unit === PX) {\n res.v.push(n[i].value * 100 / target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else {\n res.v.push(0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p.unit === AUTO || n.unit === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.parent || target).computedStyle;\n let diff = 0;\n if(p.unit === n.unit) {\n diff = n.value - p.value;\n }\n // 长度单位变化特殊计算,根据父元素computedStyle\n else if(p.unit === PX && n.unit === PERCENT) {\n let v;\n if(k === 'fontSize') {\n v = n.value * parentComputedStyle[k] * 0.01;\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.width * 0.01;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.height * 0.01;\n }\n diff = v - p.value;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v;\n if(k === 'fontSize') {\n v = n.value * 100 / parentComputedStyle[k];\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.width;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.height;\n }\n diff = v - p.value;\n }\n // lineHeight奇怪的单位变化\n else if(k === 'lineHeight') {\n if(p.unit === PX && n.unit === NUMBER) {\n diff = n.value * computedStyle.fontSize - p.value;\n }\n else if(p.unit === NUMBER && n.unit === PX) {\n diff = n.value / computedStyle.fontSize - p.value;\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res.v = diff;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n res.v.push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res.v = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\n return;\n }\n else {\n res.v = n - p;\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n if(n === p) {\n return;\n }\n res.v = n - p;\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target) {\n keys.forEach(k => {\n let ts = calDiff(prev.style, next.style, k, target);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev.transition.push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame.time > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame.time === time) {\n return middle;\n }\n else if(frame.time > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(/^\\s*(?:cubic-bezier\\s*)?\\(\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*,\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*\\)\\s*$/i.test(ea)) {\n let v = ea.match(/[\\d.]+/g);\n timingFunction = easing.cubicBezier(v[0], v[1], v[2], v[3]);\n }\n else if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing[ea] || linear;\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, percent, target) {\n let style = clone(frame.style);\n let timingFunction = getEasing(frame.easing);\n if(timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n frame.transition.forEach(item => {\n let { k, v, d, p } = item;\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === 'transform') {\n if(!st) {\n st = style[k] = [['matrix', [1, 0, 0, 1, 0, 0]]];\n }\n for(let i = 0; i < 6; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n else if(k === 'filter') {\n // 只有1个样式声明了filter另外一个为空\n if(!st) {\n st = style[k] = [['blur', 0]];\n }\n st[0][1] += v * percent;\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i].value += v[i] * percent;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n if(v !== 0) {\n st.value += v * percent;\n }\n }\n else if(k === 'transformOrigin' || k === 'backgroundSize') {\n if(v[0] !== 0) {\n st[0].value += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1].value += v[1] * percent;\n }\n }\n else if(k === 'boxShadow') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n if(GRADIENT_TYPE.hasOwnProperty(st.k)) {\n for(let i = 0, len = Math.min(st.v.length, v.length); i < len; i++) {\n let a = st.v[i];\n let b = v[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1].value += b[1] * percent;\n }\n }\n if(st.k === 'linear' && st.d !== undefined && d !== undefined) {\n st.d += d * percent;\n }\n if(st.k === 'radial' && st.p !== undefined && p !== undefined) {\n st.p[0].value += p[0] * percent;\n st.p[1].value += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st.value;\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n let st = style[k];\n if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n style[k] += v * percent;\n }\n });\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n this.__target = target;\n list = clone(list || []);\n if(Array.isArray(list)) {\n this.__list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n this.__list = nl;\n }\n else {\n this.__list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {};\n this.__duration = Math.max(0, parseFloat(op.duration) || 0);\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.iterations = op.iterations;\n this.fps = op.fps;\n this.fill = op.fill;\n this.direction = op.direction;\n this.playbackRate = op.playbackRate;\n this.__easing = op.easing;\n this.playCount = 0;\n this.spfLimit = op.spfLimit; // 定帧功能,不跳帧,每帧时间限制为最大spf\n this.__frames = []; // 每帧数据\n this.__framesR = []; // 存储反向播放的数据\n this.__startTime = null;\n this.currentTime = 0; // 当前播放时间点,不包括暂停时长,但包括delay、变速,以此定位动画处于何时\n this.__nextTime = 0; // 下一帧刷新时间点,即currentTime下一帧被此赋值\n this.__fpsTime = 0;\n this.__playState = 'idle';\n this.__isDestroyed = false;\n this.__style = {};\n this.__assigning = false; // 本帧动画是否正在影响赋值style,即在事件的before之后after之前\n this.__init();\n }\n\n __init() {\n let { iterations, duration, list, easing, target } = this;\n // 执行次数小于1无需播放\n if(iterations < 1 || list.length < 1) {\n return;\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n this.__frames = frames;\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的默认样式\n let keys = this.__keys = unify(frames, target);\n inherit(frames, keys, target);\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let o = this.__originStyle = {};\n keys.forEach(k => {\n if(change.isGeom(tagName, k)) {\n o[k] = props[k];\n }\n o[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target);\n }\n // 反向存储帧的倒排结果\n let framesR = clone(frames).reverse();\n framesR.forEach(item => {\n item.time = duration - item.time;\n item.transition = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target);\n }\n this.__framesR = framesR;\n // finish/cancel共有的before处理\n this.__clean = (isFinish) => {\n this.__cancelTask();\n this.__nextTime = 0;\n let restore;\n let style = this.style;\n if(isFinish) {\n this.__currentTime = this.delay + duration + this.endDelay;\n this.__playCount = iterations;\n this.__playState = 'finished';\n // cancel需要清除finish根据情况保留\n if(!this.__stayEnd()) {\n this.__style = {};\n restore = true;\n }\n }\n else {\n this.__playCount = this.__currentTime = 0;\n this.__playState = 'idle';\n this.__style = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(change.GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n target.__cancelCacheSvg();\n });\n }\n };\n // 生成finish的任务事件\n this.__fin = (cb, diff) => {\n this.__begin = this.__end = this.__isDelay = this.__finish = this.__inFps = this.__enterFrame = null;\n this.emit(Event.FINISH);\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n };\n // 同步执行,用在finish()这种主动调用\n this.__frameCb = (diff, isDelay) => {\n this.emit(Event.FRAME, diff, isDelay);\n if(this.__firstPlay) {\n this.__firstPlay = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(this.__playCb)) {\n this.__playCb(diff, isDelay);\n this.__playCb = null;\n }\n };\n }\n\n __calDiffTime(diff) {\n let { playbackRate, spfLimit, fps } = this;\n this.__currentTime = this.__nextTime;\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n this.__nextTime += diff;\n return this.__currentTime;\n }\n\n play(cb) {\n let { isDestroyed, duration, playState, __frameCb, list } = this;\n if(isDestroyed || duration <= 0 || list.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n this.__playCb = cb;\n this.__playState = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n this.__firstPlay = true;\n let firstEnter = true;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!this.__enterFrame) {\n let {\n frames,\n framesR,\n direction,\n delay,\n endDelay,\n __clean,\n __fin,\n target,\n } = this;\n // delay/endDelay/fill/direction在播放后就不可变更,没播放可以修改\n let stayEnd = this.__stayEnd();\n let stayBegin = this.__stayBegin();\n // 每次正常调用play都会从头开始,标识第一次enterFrame运行初始化\n this.__currentTime = this.__nextTime = this.__fpsTime = 0;\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n // 每帧执行的回调,firstEnter只有初次计算时有,第一帧强制不跳帧\n let enterFrame = this.__enterFrame = {\n before: diff => {\n let { root, fps, playCount, iterations } = this;\n if(!root) {\n return;\n }\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let currentTime = this.__calDiffTime(diff);\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!firstEnter && fps < 60) {\n diff = this.__fpsTime += diff;\n if(diff < 1000 / fps) {\n this.__inFps = true;\n return;\n }\n this.__fpsTime = 0;\n }\n firstEnter = false;\n // delay仅第一次生效\n if(playCount > 0) {\n delay = 0;\n }\n // 还没过前置delay\n if(currentTime < delay) {\n if(stayBegin) {\n let current = frames[0].style;\n genBeforeRefresh(current, this, root);\n }\n // 即便不刷新,依旧执行begin和帧回调\n if(currentTime === 0) {\n this.__begin = true;\n }\n this.__isDelay = true;\n return;\n }\n // 根据播放次数确定正反方向\n let currentFrames;\n if(direction === 'reverse') {\n currentFrames = framesR;\n }\n else if({ alternate: true, 'alternate-reverse': true }.hasOwnProperty(direction)) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = isEven ? frames : framesR;\n }\n else {\n currentFrames = isEven ? framesR : frames;\n }\n }\n else {\n currentFrames = frames;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0) {\n this.__begin = true;\n }\n let i = binarySearch(0, length - 1, currentTime, currentFrames);\n let current = currentFrames[i];\n // 最后一帧结束动画\n let isLastFrame = i === length - 1;\n let isLastCount = playCount >= iterations - 1;\n let inEndDelay;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n if(isLastFrame) {\n // endDelay实际最后一次播放时生效,这里仅计算时间对比\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n // 多次播放时到达最后一帧也会显示\n if(stayEnd || !isLastCount) {\n current = current.style;\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = this.__originStyle;\n }\n // 非尾每轮次放完增加次数和计算下轮准备\n if(!isLastCount) {\n this.__nextTime = currentTime - duration;\n playCount = ++this.__playCount;\n this.__nextBegin = true;\n }\n // 尾次考虑endDelay\n else if(!inEndDelay) {\n this.__nextTime = 0;\n playCount = ++this.__playCount;\n // 判断次数结束每帧enterFrame调用,inEndDelay时不结束\n if(playCount >= iterations) {\n frame.offFrame(enterFrame);\n }\n }\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else {\n let total = currentFrames[i + 1].time - current.time;\n let percent = (currentTime - current.time) / total;\n current = calIntermediateStyle(current, percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, this, root);\n // 每次循环完触发end事件,最后一次循环触发finish\n if(isLastFrame && (!inEndDelay || isLastCount)) {\n this.__end = true;\n if(playCount >= iterations) {\n this.__finish = true;\n __clean(true);\n }\n }\n },\n after: diff => {\n this.__assigning = false;\n if(this.__inFps) {\n this.__inFps = false;\n return;\n }\n __frameCb(diff, this.__isDelay);\n this.__isDelay = false;\n if(this.__begin) {\n this.__begin = false;\n this.emit(Event.BEGIN, this.playCount);\n }\n if(this.__end) {\n this.__end = false;\n this.emit(Event.END, this.playCount - 1);\n }\n if(this.__finish) {\n this.__finish = false;\n __fin();\n }\n if(this.__nextBegin) {\n this.__nextBegin = false;\n this.__begin = true;\n }\n },\n };\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this.__enterFrame);\n frame.onFrame(this.__enterFrame);\n this.__startTime = frame.__now;\n return this;\n }\n\n pause() {\n let { isDestroyed, duration, pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n this.__playState = 'paused';\n this.__cancelTask();\n this.emit(Event.PAUSE);\n return this;\n }\n\n resume(cb) {\n let { isDestroyed, duration, playState } = this;\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || list.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let { root, frames, __frameCb, __clean, __fin, __originStyle } = self;\n if(root) {\n let current;\n // 停留在最后一帧\n if(self.__stayEnd()) {\n current = frames[frames.length - 1].style;\n }\n else {\n current = __originStyle;\n }\n root.addRefreshTask({\n before() {\n genBeforeRefresh(current, self, root);\n __clean(true);\n },\n after(diff) {\n self.__assigning = false;\n __frameCb(diff);\n __fin(cb, diff);\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || playState === 'idle' || list.length < 1) {\n return self;\n }\n self.__cancelTask();\n let { root, __frameCb, __clean, __originStyle } = self;\n if(root) {\n let task = (diff) => {\n self.__cancelTask();\n self.__begin = self.__end = self.__isDelay = self.__finish = self.__inFps = self.__enterFrame = null;\n self.emit(Event.CANCEL);\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n };\n root.addRefreshTask({\n before() {\n genBeforeRefresh(__originStyle, self, root);\n __clean();\n },\n after(diff) {\n self.__assigning = false;\n __frameCb(diff);\n task(diff);\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n this.__playState = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb(diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let { style, target, keys } = this;\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(change.GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let { duration, iterations, delay } = this;\n this.__playState = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += delay;\n }\n // 超过时间长度需要累加次数\n while(v > duration && this.playCount < iterations - 1) {\n this.__playCount++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n this.__nextTime = v;\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __cancelTask() {\n frame.offFrame(this.__enterFrame);\n this.__playCb = null;\n }\n\n __destroy(sync) {\n let self = this;\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean && self.__clean();\n self.__target = null;\n }\n else {\n frame.nextFrame({\n before() {\n // 尚未初始化的清除\n self.__clean && self.__clean();\n self.__target = null;\n },\n });\n }\n self.__startTime = null;\n self.__isDestroyed = true;\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__target;\n }\n\n get root() {\n return this.target.root;\n }\n\n get keys() {\n return this.__keys;\n }\n\n get style() {\n return this.__style;\n }\n\n get list() {\n return this.__list;\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__duration;\n }\n\n set duration(v) {\n this.__duration = Math.max(0, parseFloat(v) || 0);\n }\n\n get delay() {\n return this.__delay;\n }\n\n set delay(v) {\n this.__delay = Math.max(0, parseFloat(v) || 0);\n }\n\n get endDelay() {\n return this.__endDelay;\n }\n\n set endDelay(v) {\n this.__endDelay = Math.max(0, parseFloat(v) || 0);\n }\n\n get fps() {\n return this.__fps;\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n if(v <= 0) {\n v = 60;\n }\n this.__fps = v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__iterations;\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n this.__iterations = v;\n }\n\n get fill() {\n return this.__fill;\n }\n\n set fill(v) {\n this.__fill = v || 'none';\n }\n\n get direction() {\n return this.__direction;\n }\n\n set direction(v) {\n this.__direction = v || 'normal';\n }\n\n get frames() {\n return this.__frames;\n }\n\n get framesR() {\n return this.__framesR;\n }\n\n get playbackRate() {\n return this.__playbackRate;\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n this.__playbackRate = v;\n }\n\n get easing() {\n return this.__easing;\n }\n\n get startTime() {\n return this.__startTime;\n }\n\n get currentTime() {\n return this.__currentTime;\n }\n\n set currentTime(v) {\n v = parseFloat(v) || 0;\n if(v >= 0) {\n this.__currentTime = this.__nextTime = v;\n }\n }\n\n get pending() {\n return this.playState !== 'running';\n }\n\n get finished() {\n return this.playState === 'finished';\n }\n\n get playState() {\n return this.__playState;\n }\n\n get playCount() {\n return this.__playCount;\n }\n\n set playCount(v) {\n this.__playCount = Math.max(0, parseInt(v) || 0);\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n get animating() {\n let { playState } = this;\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || this.__stayEnd();\n }\n\n get spfLimit() {\n return this.__spfLimit;\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n this.__spfLimit = Math.max(v, parseInt(v) || 0);\n }\n else {\n this.__spfLimit = !!v;\n }\n }\n\n get assigning() {\n return this.__assigning;\n }\n}\n\nexport default Animation;\n","import change from './change';\n\nconst ENUM = {\n // 低4位表示repaint级别\n NONE: 0, // 完全没有变化\n TRANSFORM: 1, // 仅matrix变化 1\n OPACITY: 2, // 仅透明度变化 10\n FILTER: 4, // 仅滤镜变化 100\n TRANSFORM_OPACITY: 3, // 11\n TRANSFORM_FILTER: 5, // 101\n OPACITY_FILTER: 6, // 110\n TRANSFORM_OPACITY_FILTER: 7, // 111\n REPAINT: 8, // 整体需要重绘 1000\n\n // 高位表示reflow\n REFLOW: 16, // 整体需要重排 1000000\n};\n\nconst TRANSFORM = {\n translateX: true,\n translateY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n};\n\nlet o = Object.assign({\n /**\n * 仅得出大概等级none/repaint/reflow\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n /**\n * 根据大概等级细化repaint分级\n * @param style\n * @param lv\n */\n getDetailLevel(style, lv) {\n if(o.eq(lv, ENUM.NONE)) {\n return ENUM.NONE;\n }\n if(o.eq(lv, ENUM.REPAINT)) {\n let lv = ENUM.NONE;\n for(let i in style) {\n if(style.hasOwnProperty(i)) {\n if(TRANSFORM.hasOwnProperty(i)) {\n lv |= ENUM.TRANSFORM;\n }\n else if(i === 'opacity') {\n lv |= ENUM.OPACITY;\n }\n else if(i === 'filter') {\n lv |= ENUM.FILTER;\n }\n else {\n lv |= ENUM.REPAINT;\n }\n }\n }\n return lv;\n }\n else {\n return ENUM.REFLOW;\n }\n },\n eq(lv, value) {\n return (lv & value) === value;\n },\n gt(lv, value) {\n return (lv & value) > value;\n },\n gte(lv, value) {\n return (lv & value) >= value;\n },\n lt(lv, value) {\n return (lv & value) < value;\n },\n lte(lv, value) {\n return (lv & value) <= value;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n}, ENUM);\n\nexport default o;\n","import Node from './Node';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport gradient from '../style/gradient';\nimport border from '../style/border';\nimport css from '../style/css';\nimport image from '../style/image';\nimport blur from '../style/blur';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport Animation from '../animate/Animation';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\n\nconst { AUTO, PX, PERCENT, STRING, INHERIT } = unit;\nconst { clone, int2rgba, equalArr, extend, joinArr } = util;\nconst { calRelative } = css;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBorder(renderMode, points, color, ctx, xom) {\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nfunction renderBgc(renderMode, color, x, y, w, h, ctx, xom, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr, method = 'fill') {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr);\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, w, h);\n }\n ctx[method]();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(list) {\n let d = svgPolygon(list);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color]\n ],\n });\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'rect',\n props: [\n ['x', x],\n ['y', y],\n ['width', w],\n ['height', h],\n ['fill', color]\n ],\n });\n }\n }\n}\n\nlet borderRadiusKs = ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'];\nfunction calBorderRadius(w, h, currentStyle, computedStyle) {\n let noRadius = true;\n borderRadiusKs.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item.value > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item.unit === PX) {\n return Math.max(0, item.value);\n }\n else {\n return Math.max(0, item.value * (i ? h : w) * 0.01);\n }\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n borderRadiusKs.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[borderRadiusKs[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBackgroundSize(value, w, h) {\n let res = [];\n value.forEach((item, i) => {\n if(item.unit === PX) {\n res.push(item.value);\n }\n else if(item.unit === PERCENT) {\n res.push(item.value * (i ? h : w) * 0.01);\n }\n else if(item.unit === AUTO) {\n res.push(-1);\n }\n else if(item.unit === STRING) {\n res.push(item.value === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size) {\n if(position.unit === PX) {\n return position.value;\n }\n else if(position.unit === PERCENT) {\n return (container - size) * position.value * 0.01;\n }\n return 0;\n}\n\nfunction renderBoxShadow(renderMode, ctx, defs, data, xom, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight) {\n let [x, y, blur, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(blur) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1, y4],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (blur > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = mx.int2convolution(blur);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nfunction empty() {}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n this.__refreshLevel = level.REFLOW;\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n }\n\n // 获取margin/padding的实际值\n __mp(currentStyle, computedStyle, w) {\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left',\n ].forEach(k => {\n let a = 'margin' + k;\n let b = 'padding' + k;\n computedStyle[a] = this.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(mp, w) {\n if(mp.unit === PX) {\n return mp.value;\n }\n else if(mp.unit === PERCENT) {\n return mp.value * w * 0.01;\n }\n return 0;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,比如flex列计算时\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, !this.parent);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle } = this;\n let {\n display,\n width,\n position,\n } = currentStyle;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height = computedStyle.width = computedStyle.height = 0;\n return;\n }\n this.__layoutData = clone(data);\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n if(width.unit !== AUTO) {\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n this.__ox = this.__oy = 0;\n // 3种布局,默认block\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inline') {\n this.__layoutInline(data, isVirtual);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { top, right, bottom, left } = currentStyle;\n let { parent } = this;\n if(top.unit !== AUTO) {\n let n = calRelative(currentStyle, 'top', top, parent);\n this.__offsetY(n);\n computedStyle.top = n;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n let n = calRelative(currentStyle, 'bottom', bottom, parent);\n this.__offsetY(-n);\n computedStyle.bottom = n;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n if(left.unit !== AUTO) {\n let n = calRelative(currentStyle, 'left', left, parent, true);\n this.__offsetX(n);\n computedStyle.left = n;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n let n = calRelative(currentStyle, 'right', right, parent, true);\n this.__offsetX(-n);\n computedStyle.right = n;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n }\n else if(currentStyle.position !== 'absolute') {\n computedStyle.top = computedStyle.bottom = computedStyle.left = computedStyle.right = 'auto';\n }\n // 计算结果存入computedStyle\n computedStyle.width = this.width;\n computedStyle.height = this.height;\n // 设置缓存hash,render时计算\n this.__cacheStyle = {};\n this.__cacheSvg = false;\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records = ac.__records.concat(ar.list);\n }\n // 自动播放进入列表开始播放\n else {\n ac.__auto = ac.__auto.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data) {\n let { x, y, w, h, w2, h2 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n else if(width.unit !== AUTO) {\n fixedWidth = true;\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(height.unit !== AUTO) {\n fixedHeight = true;\n switch(height.unit) {\n case PX:\n h = height.value;\n break;\n case PERCENT:\n h *= height.value * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n y += borderTopWidth + marginTop + paddingTop;\n data.y = y;\n if(width.unit === AUTO) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height.unit === AUTO) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n position,\n marginLeft,\n marginRight,\n width,\n } = style;\n if(position !== 'absolute' && width !== AUTO && marginLeft.unit === AUTO && marginRight.unit === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param ctx\n * @param defs\n */\n render(renderMode, ctx, defs) {\n if(renderMode === mode.SVG) {\n if(this.__cacheSvg) {\n let n = extend({}, this.__virtualDom);\n n.cache = true;\n this.__virtualDom = n;\n return;\n }\n this.__cacheSvg = true;\n this.__virtualDom = {\n bb: [],\n children: [],\n opacity: 1,\n };\n }\n let {\n isDestroyed,\n currentStyle,\n computedStyle,\n width,\n height,\n innerWidth,\n innerHeight,\n outerWidth,\n outerHeight,\n __cacheStyle,\n parent,\n } = this;\n if(isDestroyed || computedStyle.display === 'none') {\n return;\n }\n // 使用sx和sy渲染位置,考虑了relative和translate影响\n let { sx: x, sy: y } = this;\n let {\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth,\n borderBottomWidth,\n } = computedStyle;\n let x1 = x + marginLeft;\n let x2 = x1 + borderLeftWidth;\n let x3 = x2 + width + paddingLeft + paddingRight;\n let x4 = x3 + borderRightWidth;\n let y1 = y + marginTop;\n let y2 = y1 + borderTopWidth;\n let y3 = y2 + height + paddingTop + paddingBottom;\n let y4 = y3 + borderBottomWidth;\n let {\n backgroundPositionX,\n backgroundPositionY,\n } = currentStyle;\n let matrixCache = __cacheStyle.matrix;\n // 先根据cache计算需要重新计算的computedStyle\n if(__cacheStyle.transformOrigin === undefined) {\n __cacheStyle.transformOrigin = true;\n matrixCache = false;\n computedStyle.transformOrigin = tf.calOrigin(currentStyle.transformOrigin, outerWidth, outerHeight);\n }\n if(__cacheStyle.transform === undefined\n || __cacheStyle.translateX === undefined\n || __cacheStyle.translateY === undefined\n || __cacheStyle.rotateZ === undefined\n || __cacheStyle.scaleX === undefined\n || __cacheStyle.scaleY === undefined\n || __cacheStyle.skewX === undefined\n || __cacheStyle.skewY === undefined) {\n __cacheStyle.transform\n = __cacheStyle.translateX\n = __cacheStyle.translateY\n = __cacheStyle.rotateZ\n = __cacheStyle.scaleX\n = __cacheStyle.scaleY\n = __cacheStyle.skewX\n = __cacheStyle.skewY\n = true;\n matrixCache = false;\n let matrix;\n // transform相对于自身\n if(currentStyle.transform) {\n matrix = tf.calMatrix(currentStyle.transform, outerWidth, outerHeight);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n 'translateX',\n 'translateY',\n 'rotateZ',\n 'rotate',\n 'skewX',\n 'skewY',\n 'scaleX',\n 'scaleY',\n ].forEach(k => {\n let v = currentStyle[k];\n if(util.isNil(v)) {\n return;\n }\n computedStyle[k] = v.value;\n // scale为1和其它为0避免计算浪费\n let isScale = k.indexOf('scale') > -1;\n if(v.value === 1 && isScale || !isScale && v.value === 0) {\n return;\n }\n if(v.unit === PERCENT) {\n if(k === 'translateX') {\n computedStyle[k] = v.value * outerWidth * 0.01;\n }\n else if(k === 'translateY') {\n computedStyle[k] = v.value * outerHeight * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, outerWidth, outerHeight);\n }\n }\n this.__matrix = computedStyle.transform = matrix || [1, 0, 0, 1, 0, 0];\n }\n if(__cacheStyle.backgroundPositionX === undefined) {\n __cacheStyle.backgroundPositionX = true;\n computedStyle.backgroundPositionX = backgroundPositionX.unit === PX\n ? backgroundPositionX.value : backgroundPositionX.value * innerWidth;\n }\n if(__cacheStyle.backgroundPositionY === undefined) {\n __cacheStyle.backgroundPositionY = true;\n computedStyle.backgroundPositionY = backgroundPositionY.unit === PX\n ? backgroundPositionY.value : backgroundPositionY.value * innerWidth;\n }\n if(__cacheStyle.backgroundSize === undefined) {\n __cacheStyle.backgroundSize = true;\n computedStyle.backgroundSize = calBackgroundSize(currentStyle.backgroundSize, innerWidth, innerHeight);\n }\n if(__cacheStyle.backgroundImage === undefined) {\n let backgroundImage = computedStyle.backgroundImage = currentStyle.backgroundImage;\n // 防止隐藏不加载背景图\n if(util.isString(backgroundImage)) {\n __cacheStyle.backgroundImage = true;\n let loadBgi = this.__loadBgi;\n let cache = inject.IMG[backgroundImage];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = backgroundImage;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n if(loadBgi.url !== backgroundImage) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = backgroundImage;\n loadBgi.source = null;\n inject.measureImg(backgroundImage, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.__isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n let node = this;\n node.__cancelCacheSvg();\n let root = node.root;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n before() {\n root.__addUpdate({\n node,\n focus: level.REPAINT,\n });\n },\n });\n }\n }, {\n width: innerWidth,\n height: innerHeight,\n });\n }\n }\n else if(backgroundImage && backgroundImage.k) {\n __cacheStyle.backgroundImage = this.__gradient(renderMode, ctx, defs, x2, y2, x3, y3, innerWidth, innerHeight, backgroundImage);\n }\n }\n if(__cacheStyle.boxShadow === undefined) {\n __cacheStyle.boxShadow = true;\n computedStyle.boxShadow = currentStyle.boxShadow;\n }\n // 这些直接赋值的不需要再算缓存\n [\n 'opacity',\n 'zIndex',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundRepeat',\n 'filter',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n [\n 'backgroundColor',\n 'borderTopColor',\n 'borderRightColor',\n 'borderBottomColor',\n 'borderLeftColor',\n ].forEach(k => {\n if(__cacheStyle[k] === undefined) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k].value);\n }\n });\n // 强制计算继承性的\n if(parent) {\n let parentComputedStyle = parent.computedStyle;\n [\n 'fontStyle',\n 'color',\n 'visibility',\n 'pointerEvents',\n ].forEach(k => {\n if(currentStyle[k].unit === INHERIT) {\n computedStyle[k] = parentComputedStyle[k];\n }\n else {\n computedStyle[k] = currentStyle[k].value;\n }\n if(k === 'color') {\n __cacheStyle.color = int2rgba(computedStyle.color);\n }\n });\n }\n // root和component的根节点不能是inherit\n else {\n [\n 'fontStyle',\n 'color',\n 'visibility',\n 'pointerEvents',\n ].forEach(k => {\n if(currentStyle[k].unit !== INHERIT) {\n computedStyle[k] = currentStyle[k].value;\n if(k === 'color') {\n __cacheStyle.color = int2rgba(computedStyle.color)\n }\n }\n });\n if(currentStyle.fontStyle.unit === INHERIT) {\n computedStyle.fontStyle = 'normal';\n }\n if(currentStyle.fontWeight.unit === INHERIT) {\n computedStyle.fontWeight = 400;\n }\n if(currentStyle.color.unit === INHERIT) {\n computedStyle.color = [0, 0, 0, 1];\n __cacheStyle.color = 'rgba(0,0,0,1)';\n }\n if(currentStyle.visibility.unit === INHERIT) {\n computedStyle.visibility = 'visible';\n }\n if(currentStyle.pointerEvents.unit === INHERIT) {\n computedStyle.pointerEvents = 'auto';\n }\n }\n // 圆角边计算\n if(__cacheStyle.borderTopLeftRadius === undefined\n || __cacheStyle.borderTopRightRadius === undefined\n || __cacheStyle.borderBottomRightRadius === undefined\n || __cacheStyle.borderBottomLeftRadius === undefined) {\n __cacheStyle.borderTopLeftRadius\n = __cacheStyle.borderTopRightRadius\n = __cacheStyle.borderBottomRightRadius\n = __cacheStyle.borderBottomLeftRadius\n = true;\n calBorderRadius(outerWidth, outerHeight, currentStyle, computedStyle);\n }\n let {\n backgroundColor,\n borderTopColor,\n borderTopStyle,\n borderRightColor,\n borderRightStyle,\n borderBottomColor,\n borderBottomStyle,\n borderLeftColor,\n borderLeftStyle,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n backgroundRepeat,\n backgroundImage,\n opacity,\n filter,\n backgroundSize,\n transformOrigin,\n transform,\n boxShadow,\n } = computedStyle;\n let p = parent || this.host && this.host.parent;\n // 先设置透明度,canvas可以向上累积\n if(renderMode === mode.CANVAS) {\n if(p) {\n opacity *= p.__opacity;\n }\n this.__opacity = opacity;\n if(ctx.globalAlpha !== opacity) {\n ctx.globalAlpha = opacity;\n }\n }\n else {\n this.__virtualDom.opacity = opacity;\n }\n // 省略计算\n let matrix;\n if(matrixCache) {\n matrix = matrixCache;\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += x;\n tfo[1] += y;\n matrix = transform;\n matrix = __cacheStyle.matrix = tf.calMatrixByOrigin(matrix, tfo);\n }\n let renderMatrix = this.__svgMatrix = matrix;\n // 变换对事件影响,canvas要设置渲染\n if(p) {\n matrix = mx.multiply(p.matrixEvent, matrix);\n }\n this.__matrixEvent = matrix;\n if(renderMode === mode.CANVAS) {\n ctx.setTransform(...matrix);\n }\n else if(renderMode === mode.SVG) {\n if(!equalArr(renderMatrix, [1, 0, 0, 1, 0, 0])) {\n this.virtualDom.transform = 'matrix(' + joinArr(renderMatrix, ',') + ')';\n }\n }\n // 隐藏不渲染,但要加载背景图\n if(visibility === 'hidden') {\n return;\n }\n // canvas的blur需绘制到离屏上应用后反向绘制回来\n let offScreen;\n if(filter && renderMode === mode.CANVAS) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let { width, height } = this.root;\n let c = inject.getCacheCanvas(width, height, '__$$blur$$__');\n if(c.ctx) {\n offScreen = {\n ctx,\n };\n offScreen.target = c;\n ctx = c.ctx;\n }\n }\n });\n }\n // 背景色垫底\n if(backgroundColor[3] > 0) {\n renderBgc(renderMode, __cacheStyle.backgroundColor, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n if(util.isString(backgroundImage)) {\n let loadBgi = this.__loadBgi;\n if(loadBgi.url === backgroundImage) {\n let source = loadBgi.source;\n // 无source不绘制\n if(source) {\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize;\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > innerWidth && height > innerHeight) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w >= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(width > innerWidth) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(height > innerHeight) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(innerWidth > width && innerHeight > height) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(innerWidth > width) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(innerHeight > height) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = x2 + calBackgroundPosition(backgroundPositionX, innerWidth, w);\n let bgY = y2 + calBackgroundPosition(backgroundPositionY, innerHeight, h);\n // 超出尺寸模拟mask截取\n let needMask = bgX < x2 || bgY < y2 || w > innerWidth || h > innerHeight;\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgX - x2;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = x2 + innerWidth - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgY - y2;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = y2 + innerHeight - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < x2) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > x2 + innerWidth) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < y2) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > y2 + innerHeight) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n if(needMask) {\n ctx.save();\n renderBgc(renderMode, '#FFF', x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, innerWidth, innerHeight);\n let props = [\n ['xlink:href', backgroundImage],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height]\n ];\n let needResize;\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(matrix, ',') + ')']);\n }\n if(needMask) {\n let id = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'rect',\n props: [\n ['x', x2],\n ['y', y2],\n ['width', innerWidth],\n ['height', innerHeight],\n ['fill', '#FFF']\n ],\n }],\n });\n this.virtualDom.bbClip = 'url(#' + id + ')';\n }\n // 先画不考虑repeat的中心声明的\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], innerWidth, innerHeight);\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n copy[5][1] = 'matrix(' + joinArr(matrix, ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n }\n else if(backgroundImage.k) {\n renderBgc(renderMode, __cacheStyle.backgroundImage, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n renderBoxShadow(renderMode, ctx, defs, item, this, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let points = border.calPoints(borderTopWidth, borderTopStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 0,\n borderTopLeftRadius, borderTopRightRadius);\n renderBorder(renderMode, points, __cacheStyle.borderTopColor, ctx, this);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n let points = border.calPoints(borderRightWidth, borderRightStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 1,\n borderTopRightRadius, borderBottomRightRadius);\n renderBorder(renderMode, points, __cacheStyle.borderRightColor, ctx, this);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let points = border.calPoints(borderBottomWidth, borderBottomStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 2,\n borderBottomLeftRadius, borderBottomRightRadius);\n renderBorder(renderMode, points, __cacheStyle.borderBottomColor, ctx, this);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let points = border.calPoints(borderLeftWidth, borderLeftStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 3,\n borderTopLeftRadius, borderBottomLeftRadius);\n renderBorder(renderMode, points, __cacheStyle.borderLeftColor, ctx, this);\n }\n if(filter) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n if(renderMode === mode.CANVAS) {\n offScreen.blur = v;\n }\n else if(renderMode === mode.SVG) {\n // 模糊框卷积尺寸 #66\n let d = mx.int2convolution(v);\n let id = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feGaussianBlur',\n props: [\n ['stdDeviation', v],\n ],\n }\n ],\n });\n this.virtualDom.filter = 'url(#' + id + ')';\n }\n }\n });\n }\n return offScreen;\n }\n\n __renderByMask(renderMode, ctx, defs) {\n let { next, root } = this;\n let hasMask = next && next.isMask;\n let hasClip = next && next.isClip;\n if(!hasMask && !hasClip) {\n this.render(renderMode, ctx, defs);\n return;\n }\n if(renderMode === mode.CANVAS) {\n // canvas借用2个离屏canvas来处理,c绘制本xom,m绘制多个mask\n if(hasMask) {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$mask1$$__');\n this.render(renderMode, c.ctx);\n // 收集之前的mask列表\n let list = [];\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n // 当mask只有1个时,无需生成m,直接在c上即可\n if(list.length === 1) {\n next = list[0];\n c.ctx.globalCompositeOperation = 'destination-in';\n next.render(renderMode, c.ctx);\n // 为小程序特殊提供的draw回调,每次绘制调用都在攒缓冲,drawImage另一个canvas时刷新缓冲,需在此时主动flush\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n }\n // 多个借用m绘制mask,用c结合mask获取结果,最终结果再到当前画布\n else {\n let m = inject.getCacheCanvas(width, height, '__$$mask2$$__');\n list.forEach(item => {\n item.render(renderMode, m.ctx);\n });\n m.draw(m.ctx);\n c.ctx.globalCompositeOperation = 'destination-in';\n c.ctx.drawImage(m.canvas, 0, 0);\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n // 清除\n m.ctx.globalCompositeOperation = 'source-over';\n m.ctx.clearRect(0, 0, width, height);\n m.draw(m.ctx);\n }\n ctx.restore();\n // 清除\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, width, height);\n c.draw(c.ctx);\n }\n // 劫持canvas原生方法使得多个clip矢量连续绘制\n else if(hasClip) {\n ctx.save();\n ctx.beginPath();\n let fill = ctx.fill;\n let beginPath = ctx.beginPath;\n let closePath = ctx.closePath;\n ctx.fill = ctx.beginPath = ctx.closePath = empty;\n while(next && next.isClip) {\n next.render(renderMode, ctx);\n next = next.next;\n }\n ctx.fill = fill;\n ctx.beginPath = beginPath;\n ctx.closePath = closePath;\n ctx.clip();\n ctx.closePath();\n this.render(renderMode, ctx);\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n this.render(renderMode, ctx, defs);\n // 检查后续mask是否是空,空遮罩不生效\n let isEmpty = true;\n let sibling = next;\n outer:\n while(sibling) {\n let { children } = sibling.virtualDom;\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n for(let j = 0, len = props.length; j < len; j++) {\n let [k, v] = props[i];\n if(k === 'd') {\n if(v) {\n isEmpty = false;\n break outer;\n }\n }\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n if(isEmpty) {\n return;\n }\n // 应用mask本身的matrix,以及被遮罩对象的matrix逆\n sibling = next;\n let mChildren = [];\n while(sibling) {\n let { children } = sibling.virtualDom;\n mChildren = mChildren.concat(children);\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n let matrix = sibling.svgMatrix;\n let inverse = mx.inverse(this.svgMatrix);\n matrix = mx.multiply(matrix, inverse);\n // transform属性放在最后一个省去循环\n let len = props.length;\n if(!len || props[len - 1][0] !== 'transform') {\n props.push(['transform', `matrix(${matrix})`]);\n }\n else {\n props[len - 1][1] = `matrix(${matrix})`;\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n let id = defs.add({\n tagName: hasClip ? 'clipPath' : 'mask',\n props: [],\n children: mChildren,\n });\n id = 'url(#' + id + ')';\n // 作为mask会在defs生成maskId供使用,多个连续mask共用一个id\n if(hasMask) {\n this.virtualDom.mask = id;\n }\n else if(hasClip) {\n this.virtualDom.clip = id;\n }\n }\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n let ref = this.props.ref;\n if(ref) {\n let owner = this.host || this.root;\n if(owner && owner.ref[ref]) {\n delete owner.ref[ref];\n }\n }\n this.animationList.forEach(item => item.__destroy());\n this.root.delRefreshTask(this.__loadBgi.cb);\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__matrix = this.__matrixEvent = this.__root = null;\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n e.target = this;\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e) {\n let { x, y } = e;\n let { sx, sy, outerWidth, outerHeight, matrixEvent,\n computedStyle: { pointerEvents } } = this;\n if(pointerEvents === 'none') {\n return;\n }\n let inThis = tf.pointInQuadrilateral(\n x, y,\n sx, sy,\n sx + outerWidth, sy,\n sx + outerWidth, sy + outerHeight,\n sx, sy + outerHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root.__touchstartTarget = this;\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, defs, x2, y2, x3, y3, iw, ih, vs) {\n let { k, v, d, s, z, p } = vs;\n let cx = x2 + iw * 0.5;\n let cy = y2 + ih * 0.5;\n let res;\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, cx, cy, iw, ih);\n res = this.__getLg(renderMode, ctx, defs, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, x2, y2, x3, y3);\n res = this.__getRg(renderMode, ctx, defs, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, defs, gd) {\n if(renderMode === mode.CANVAS) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], item[0]);\n });\n return lg;\n }\n else if(renderMode === mode.SVG) {\n let uuid = defs.add({\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2]\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', item[0]],\n ['offset', item[1] * 100 + '%']\n ],\n };\n }),\n });\n return 'url(#' + uuid + ')';\n }\n }\n\n __cancelCacheSvg() {\n this.__cacheSvg = false;\n }\n\n __cancelCache() {\n this.__cancelCacheSvg();\n this.__cacheStyle = {};\n }\n\n __getRg(renderMode, ctx, defs, gd) {\n if(renderMode === mode.CANVAS) {\n let rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.cx, gd.cy, gd.r);\n gd.stop.forEach(item => {\n rg.addColorStop(item[1], item[0]);\n });\n return rg;\n }\n else if(renderMode === mode.SVG) {\n let uuid = defs.add({\n tagName: 'radialGradient',\n props: [\n ['cx', gd.cx],\n ['cy', gd.cy],\n ['r', gd.r]\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', item[0]],\n ['offset', item[1] * 100 + '%']\n ],\n };\n }),\n });\n return 'url(#' + uuid + ')';\n }\n }\n\n updateStyle(style, cb) {\n let { tagName, root, props, style: os } = this;\n if(root) {\n let hasChange;\n // 先去掉缩写\n let ks = Object.keys(style);\n ks.forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n // 此处仅检测样式是否有效\n for(let i in style) {\n if(style.hasOwnProperty(i)) {\n // 是规定内的合法样式\n if(change.isValid(tagName, i)) {\n if(change.isGeom(tagName, i)) {\n if(!css.equalStyle(i, style[i], props[i], this)) {\n hasChange = true;\n }\n }\n else if(!css.equalStyle(i, style[i], os[i], this)) {\n hasChange = true;\n }\n }\n else {\n delete style[i];\n }\n }\n }\n // 空样式或非法或无改变直接返回\n if(!hasChange) {\n if(util.isFunction(cb)) {\n cb(0);\n }\n return;\n }\n let node = this;\n root.addRefreshTask(node.__task = {\n before() {\n if(node.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node,\n style,\n origin: true, // 标识样式未经过normalize,不同于animate\n overwrite: true, // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n });\n },\n after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n }\n\n animate(list, options) {\n if(this.isDestroyed) {\n return;\n }\n let animation = new Animation(this, list, options);\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n css.computeMeasure(this, isHost);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n deepScan(cb, options) {\n return cb(this, options);\n }\n\n __resizeX(dx) {\n this.computedStyle.width = this.__width += dx;\n }\n\n __resizeY(dy) {\n this.computedStyle.height = this.__height += dy;\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get innerWidth() {\n let {\n computedStyle: {\n display,\n paddingRight,\n paddingLeft,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.width\n + paddingLeft\n + paddingRight;\n }\n\n get innerHeight() {\n let {\n computedStyle: {\n display,\n paddingTop,\n paddingBottom,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.height\n + paddingTop\n + paddingBottom;\n }\n\n get outerWidth() {\n let {\n computedStyle: {\n display,\n borderLeftWidth,\n borderRightWidth,\n marginRight,\n marginLeft,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerWidth\n + borderLeftWidth\n + borderRightWidth\n + marginLeft\n + marginRight;\n }\n\n get outerHeight() {\n let {\n computedStyle: {\n display,\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerHeight\n + borderTopWidth\n + borderBottomWidth\n + marginTop\n + marginBottom;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__matrix;\n }\n\n get matrixEvent() {\n return this.__matrixEvent;\n }\n\n get svgMatrix() {\n return this.__svgMatrix;\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get layoutData() {\n return this.__layoutData;\n }\n\n}\n\nexport default Xom;\n","class LineGroup {\n constructor(x, y) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__baseLine = 0;\n }\n\n add(item) {\n this.list.push(item);\n }\n\n __calBaseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return baseLine;\n }\n\n verticalAlign() {\n let n = this.__baseLine = this.__calBaseLine();\n // 仅当有2个和以上时才需要vertical对齐调整\n if(this.list.length > 1) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n horizonAlign(diff) {\n this.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n\n get list() {\n return this.__list;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n let width = 0;\n this.list.forEach(item => {\n width += item.outerWidth;\n });\n return width;\n }\n\n get height() {\n let height = 0;\n this.list.forEach(item => {\n height = Math.max(height, item.outerHeight);\n });\n return height;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get marginBottom() {\n let n = 0;\n this.list.forEach(item => {\n n = Math.max(n, item.computedStyle.marginBottom);\n });\n return n;\n }\n}\n\nexport default LineGroup;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flattenJson({\n children: cd,\n $$type: TYPE_VD,\n });\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\n\nfunction initCp(json, root, owner) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n let vd = build(json, root, owner, owner);\n if(Array.isArray(vd)) {\n relation(owner, vd);\n }\n return vd;\n }\n else {\n return new Text(json);\n }\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param owner\n * @param host\n * @returns vd\n */\nfunction build(json, root, owner, host) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, owner, host));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, inherit, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_PL) {\n return json.value;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'div' || tagName === 'span') {\n vd = new Dom(tagName, props);\n }\n else if(tagName === 'img') {\n vd = new Img(tagName, props);\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, owner, host));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = vd.__tagName || tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用\n json.vd = vd;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = vd;\n });\n }\n // 更新过程中key相同的vd继承动画\n if(inherit) {\n util.extendAnimate(inherit, vd);\n }\n vd.__root = root;\n if(host) {\n vd.__host = host;\n }\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n owner.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children.children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && (children.$$type === TYPE_CP || children.$$type === TYPE_PL)) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n if(children instanceof Dom) {\n relation(children, children.children);\n }\n // 文字视作为父节点的直接文字子节点\n else if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initCp,\n flattenJson,\n relation,\n build,\n};\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.__state = {};\n this.__isMounted = false;\n }\n\n setState(n, cb) {\n if(isNil(n)) {\n n = {};\n }\n else {\n let state = clone(this.state);\n n = extend(state, n);\n }\n let root = this.root;\n if(root && this.__isMounted) {\n root.delRefreshTask(this.__task);\n this.__task = {\n before: () => {\n // 标识更新\n this.__nextState = n;\n setUpdateFlag(this);\n },\n after: () => {\n if(isFunction(cb)) {\n cb();\n }\n },\n __state: true, // 特殊标识来源让root刷新时识别\n };\n root.addRefreshTask(this.__task);\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n this.__state = n;\n cb();\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n let root = this.root;\n let cd = json || builder.flattenJson(this.render());\n let sr = builder.initCp(cd, root, this, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n console.warn('Component render() return a text, should not inherit style/event');\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr,以及自定义事件\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n }\n else if(sr instanceof Component) {\n // 本身build是递归的,子cp已经初始化了\n console.warn('Component render() return a component: '\n + this.tagName + ' -> ' + sr.tagName\n + ', should not inherit style/event');\n }\n else {\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n sr.__host = this;\n this.__shadowRoot = sr;\n if(!this.__isMounted) {\n this.__isMounted = true;\n let { componentDidMount } = this;\n if(isFunction(componentDidMount)) {\n root.once(Event.REFRESH, () => {\n componentDidMount.call(this);\n });\n }\n }\n }\n\n render() {\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n let { componentWillUnmount } = this;\n if(isFunction(componentWillUnmount)) {\n componentWillUnmount.call(this);\n this.__isMounted = false;\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__shadowRoot = null;\n this.__parent = null;\n }\n\n __emitEvent(e) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n sr.__computeMeasure(renderMode, ctx);\n }\n // 其它类型为Xom或Component\n else {\n sr.__computeMeasure(renderMode, ctx, true, cb);\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'style',\n 'animating',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'animateProps',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n 'layoutData',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n '__cancelCacheSvg',\n 'deepScan',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineGroup from './LineGroup';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport blur from '../style/blur';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__lineGroups = []; // 一行inline元素组成的LineGroup对象后的存放列表\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style.fontWeight && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n }\n\n // 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Xom || item instanceof Component) {\n w -= item.__tryLayInline(w, total);\n }\n else {\n w -= item.textWidth;\n }\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout);\n }\n });\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout);\n }\n });\n }\n\n __calAutoBasis(isDirectionRow, w, h, isRecursion) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n marginLeft,\n marginTop,\n marginRight,\n marginBottom,\n paddingLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit === PX) {\n b = max = main.value;\n // 递归时children的长度会影响flex元素的最小宽度\n if(isRecursion) {\n min = b;\n }\n }\n // 递归children取最大值\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { b: b2, min: min2, max: max2 } = item.__calAutoBasis(isDirectionRow, w, h, true);\n b = Math.max(b, b2);\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n // 文本水平\n else if(isDirectionRow) {\n min = Math.max(item.charWidth, min);\n max = Math.max(item.textWidth, max);\n }\n // 文本垂直\n else {\n css.computeReflow(item);\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n // margin/padding/border也得计算在内,此时还没有,百分比相对于父flex元素的宽度\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth.value + borderRightWidth.value + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth.value + borderBottomWidth.value + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return { b, min, max };\n }\n\n // 换算margin/padding为px单位\n __calMp(v, w) {\n let n = 0;\n if(v.unit === PX) {\n n += v.value;\n }\n else if(v.unit === PERCENT) {\n v.value *= w * 0.01;\n v.unit = PX;\n n += v.value;\n }\n return n;\n }\n\n // 本身block布局时计算好所有子元素的基本位置\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, lineGroups } = this;\n lineGroups.splice(0);\n let {\n textAlign,\n } = computedStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 递归布局,将inline的节点组成lineGroup一行\n let lineGroup = new LineGroup(x, y);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(item.currentStyle.display === 'inline') {\n // inline开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.outerWidth;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x, w);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.outerWidth;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.outerWidth;\n }\n }\n }\n else {\n // block/flex先处理之前可能的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n y += lineGroup.height + lineGroup.marginBottom;\n lineGroup = new LineGroup(data.x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n x = data.x;\n y += item.outerHeight;\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n }\n }\n // 文字和inline类似\n else {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.width;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.width;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.width;\n }\n }\n }\n });\n // 结束后处理可能遗留的最后的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n // flex/abs的虚拟前置布局,无需真正计算\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n else {\n maxW = Math.max(maxW, cw);\n }\n y += lineGroup.height;\n }\n this.__width = fixedWidth || !isVirtual ? w : maxW;\n this.__height = fixedHeight ? h : y - data.y;\n if(lineGroup.size) {\n y += lineGroup.marginBottom;\n }\n // text-align\n if(!isVirtual && ['center', 'right'].indexOf(textAlign) > -1) {\n lineGroups.forEach(lineGroup => {\n let diff = w - lineGroup.width;\n if(diff > 0) {\n lineGroup.horizonAlign(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n if(!isVirtual) {\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle } = this;\n let {\n flexDirection,\n justifyContent,\n alignItems,\n } = currentStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n let maxX = 0;\n let isDirectionRow = flexDirection === 'row';\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let minList = [];\n let growSum = 0;\n let shrinkSum = 0;\n let basisSum = 0;\n let maxSum = 0;\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n // abs虚拟布局计算时纵向也是看横向宽度\n let { b, min, max } = item.__calAutoBasis(isVirtual ? true : isDirectionRow, w, h);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { currentStyle, computedStyle } = item;\n let { flexGrow, flexShrink, flexBasis } = currentStyle;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n growSum += flexGrow;\n shrinkSum += flexShrink;\n // 根据basis不同,计算方式不同\n if(flexBasis.unit === AUTO) {\n basisList.push(max);\n basisSum += max;\n }\n else if(flexBasis.unit === PX) {\n computedStyle.flexBasis = b = flexBasis.value;\n basisList.push(b);\n basisSum += b;\n }\n else if(flexBasis.unit === PERCENT) {\n b = computedStyle.flexBasis = (isDirectionRow ? w : h) * flexBasis.value * 0.01;\n basisList.push(b);\n basisSum += b;\n }\n maxSum += max;\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n shrinkSum += 1;\n if(isDirectionRow) {\n basisList.push(item.textWidth);\n basisSum += item.textWidth;\n maxSum += item.textWidth;\n minList.push(item.charWidth);\n }\n else {\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n basisList.push(item.height);\n basisSum += item.height;\n maxSum += item.height;\n minList.push(item.height);\n }\n }\n });\n if(isVirtual) {\n this.__width = Math.min(maxX, w);\n return;\n }\n let maxCross = 0;\n // 判断是否超出,决定使用grow还是shrink\n let isOverflow = maxSum > (isDirectionRow ? w : h);\n flowChildren.forEach((item, i) => {\n let main;\n let shrink = shrinkList[i];\n let grow = growList[i];\n // 计算主轴长度\n if(isOverflow) {\n let overflow = basisSum - (isDirectionRow ? w : h);\n main = shrink ? (basisList[i] - overflow * shrink / shrinkSum) : basisList[i];\n }\n else {\n let free = (isDirectionRow ? w : h) - basisSum;\n main = grow ? (basisList[i] + free * grow / growSum) : basisList[i];\n }\n // 主轴长度的最小值不能小于元素的最小长度,比如横向时的字符宽度\n main = Math.max(main, minList[i]);\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n let {\n display,\n flexDirection,\n width,\n height,\n } = currentStyle;\n // flex的child如果是inline,变为block\n if(display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n if(isDirectionRow) {\n // 横向flex的child如果是竖向flex,高度自动的话要等同于父flex的高度\n if(display === 'flex' && flexDirection === 'column' && fixedHeight && height.unit === AUTO) {\n height.value = h;\n height.unit = PX;\n }\n item.__layout({\n x,\n y,\n w: main,\n h,\n });\n }\n else {\n // 竖向flex的child如果是横向flex,宽度自动的话要等同于父flex的宽度\n if(display === 'flex' && flexDirection === 'row' && width.unit === AUTO) {\n width.value = w;\n width.unit = PX;\n }\n item.__layout({\n x,\n y,\n w,\n h: main,\n });\n }\n // 重设因伸缩而导致的主轴长度\n if(isOverflow && shrink || !isOverflow && grow) {\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n if(isDirectionRow) {\n item.__width = main - marginLeft - marginRight - paddingLeft - paddingRight - borderLeftWidth - borderRightWidth;\n }\n else {\n item.__height = main - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n }\n else {\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? w - x + data.x : h - y + data.y;\n // 主轴侧轴对齐方式\n if(!isOverflow && growSum === 0 && diff > 0) {\n let len = flowChildren.length;\n if(justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n // 子元素侧轴伸展\n if(isDirectionRow) {\n // 父元素固定高度,子元素可能超过,侧轴最大长度取固定高度\n if(fixedHeight) {\n maxCross = h;\n }\n y += maxCross;\n }\n else {\n if(fixedWidth) {\n maxCross = w;\n }\n }\n // 侧轴对齐\n if(!isVirtual) {\n if(alignItems === 'stretch') {\n // 短侧轴的children伸张侧轴长度至相同,超过的不动,固定宽高的也不动\n flowChildren.forEach(item => {\n let { computedStyle, currentStyle } = item;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n if(isDirectionRow) {\n if(currentStyle.height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n if(currentStyle.width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\n });\n }\n else if(alignItems === 'center') {\n flowChildren.forEach(item => {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n });\n }\n else if(alignItems === 'flex-end') {\n flowChildren.forEach(item => {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n });\n }\n }\n this.__width = w;\n this.__height = fixedHeight ? h : y - data.y;\n this.__marginAuto(currentStyle, data);\n }\n\n // inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n __layoutInline(data, isVirtual) {\n let { flowChildren, computedStyle, lineGroups } = this;\n lineGroups.splice(0);\n let {\n textAlign,\n } = computedStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 递归布局,将inline的节点组成lineGroup一行\n let lineGroup = new LineGroup(x, y);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(item.computedStyle.display !== 'inline') {\n item.currentStyle.display = item.computedStyle.display = 'inline';\n console.error('Inline can not contain block/flex');\n }\n // inline开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item); console.log('inline');\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.outerWidth;\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x, w);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n x = data.x;\n y += lineGroup.height;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n x += item.outerWidth;\n lineGroup.add(item);\n cw += item.outerWidth;\n }\n }\n // inline里的其它只有文本\n else {\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.width;\n maxW = Math.max(maxW, cw);\n cw = item.width;\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n x = data.x;\n y += lineGroup.height;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n x += item.width;\n lineGroup.add(item);\n cw += item.width;\n }\n }\n });\n // 结束后处理可能遗留的最后的lineGroup,children为空时可能size为空\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n // flex/abs的虚拟前置布局,无需真正计算\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n y += lineGroup.height;\n maxW = Math.max(maxW, cw);\n }\n // 元素的width不能超过父元素w\n this.__width = fixedWidth ? w : maxW;\n this.__height = fixedHeight ? h : y - data.y;\n // text-align\n if(!isVirtual && ['center', 'right'].indexOf(textAlign) > -1) {\n lineGroups.forEach(lineGroup => {\n let diff = this.__width - lineGroup.width;\n if(diff > 0) {\n lineGroup.horizonAlign(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, innerWidth, innerHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n display,\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingLeft,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target && target !== item) {\n return;\n }\n let { currentStyle, computedStyle } = item;\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, innerWidth);\n if(computedStyle.display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n let { left, top, right, bottom, width, height, display, flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left.unit !== AUTO) {\n fixedLeft = true;\n computedStyle.left = calAbsolute(currentStyle, 'left', left, innerWidth);\n }\n else {\n computedStyle.left = 'auto';\n }\n if(right.unit !== AUTO) {\n fixedRight = true;\n computedStyle.right = calAbsolute(currentStyle, 'right', right, innerWidth);\n }\n else {\n computedStyle.right = 'auto';\n }\n if(top.unit !== AUTO) {\n fixedTop = true;\n computedStyle.top = calAbsolute(currentStyle, 'top', top, innerHeight);\n }\n else {\n computedStyle.top = 'auto';\n }\n if(bottom.unit !== AUTO) {\n fixedBottom = true;\n computedStyle.bottom = calAbsolute(currentStyle, 'bottom', bottom, innerHeight);\n }\n else {\n computedStyle.bottom = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle.left;\n w2 = x + innerWidth - computedStyle.right - x2;\n }\n else if(fixedLeft && width.unit !== AUTO) {\n x2 = x + computedStyle.left;\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n else if(fixedRight && width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n x2 = x + innerWidth - computedStyle.right - w2;\n // 右对齐有尺寸时y值还需减去margin/border/padding的\n x2 -= computedStyle.marginLeft;\n x2 -= computedStyle.marginRight;\n x2 -= computedStyle.paddingLeft;\n x2 -= computedStyle.paddingRight;\n x2 -= currentStyle.borderLeftWidth.value;\n x2 -= currentStyle.borderRightWidth.value;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle.left;\n }\n else if(fixedRight) {\n x2 = x + innerWidth - computedStyle.right;\n onlyRight = true;\n }\n else {\n x2 = x + paddingLeft;\n if(width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle.top;\n h2 = y + innerHeight - computedStyle.bottom - y2;\n }\n else if(fixedTop && height.unit !== AUTO) {\n y2 = y + computedStyle.top;\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n else if(fixedBottom && height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n y2 = y + innerHeight - computedStyle.bottom - h2;\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle.marginTop;\n y2 -= computedStyle.marginBottom;\n y2 -= computedStyle.paddingTop;\n y2 -= computedStyle.paddingBottom;\n y2 -= currentStyle.borderTopWidth.value;\n y2 -= currentStyle.borderBottomWidth.value;\n }\n else if(fixedTop) {\n y2 = y + computedStyle.top;\n }\n else if(fixedBottom) {\n y2 = y + innerHeight - computedStyle.bottom;\n onlyBottom = true;\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y;\n let prev = item.prev;\n while(prev) {\n if(prev instanceof Text || prev.computedStyle.position !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(!prev) {\n y2 = y;\n }\n if(height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if(display === 'block' && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : innerWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : innerHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n if(target) {\n return;\n }\n // 递归进行,遇到absolute/relative的设置新容器\n children.forEach(item => {\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n }\n\n render(renderMode, ctx, defs) {\n let offScreen = super.render(renderMode, ctx, defs);\n if(offScreen && offScreen.target && offScreen.target.ctx) {\n ctx = offScreen.target.ctx;\n }\n // 降级\n else {\n offScreen = null;\n }\n // 不显示的为了diff也要根据type生成\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'dom';\n }\n let { isDestroyed, computedStyle: { display }, children } = this;\n if(isDestroyed || display === 'none' || !children.length) {\n return;\n }\n // 先渲染过滤mask\n children.forEach(item => {\n if(item.isMask || item.isClip) {\n item.__renderAsMask(renderMode, ctx, defs, !item.isMask);\n }\n });\n // 按照zIndex排序绘制过滤mask,同时由于svg严格按照先后顺序渲染,没有z-index概念,需要排序将relative/absolute放后面\n let zIndex = this.zIndexChildren;\n zIndex.forEach(item => {\n item.__renderByMask(renderMode, ctx, defs);\n });\n // 模糊滤镜写回\n if(renderMode === mode.CANVAS && offScreen) {\n let { width, height } = this.root;\n let webgl = inject.getCacheWebgl(width, height);\n let res = blur.gaussBlur(offScreen.target, webgl, offScreen.blur, width, height);\n offScreen.ctx.drawImage(offScreen.target.canvas, 0, 0);\n offScreen.target.draw();\n res.clear();\n }\n // img的children在子类特殊处理\n else if(renderMode === mode.SVG && this.tagName !== 'img') {\n this.virtualDom.children = zIndex.map(item => item.virtualDom);\n // 没变化则将text孩子设置cache\n if(this.virtualDom.cache) {\n this.virtualDom.children.forEach(item => {\n if(item.type === 'text') {\n item.cache = true;\n }\n });\n }\n }\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param isHost\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, isHost, cb) {\n super.__computeMeasure(renderMode, ctx, isHost, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, false, cb);\n });\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n this.children.splice(0);\n this.lineGroups.splice(0);\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n }\n // child不触发再看自己\n return super.__emitEvent(e);\n }\n\n __cancelCacheSvg(recursion) {\n super.__cancelCacheSvg();\n if(recursion) {\n this.children.forEach(child => {\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n child.__cancelCacheSvg(recursion);\n }\n });\n }\n }\n\n __cancelCache(recursion) {\n super.__cancelCache();\n if(recursion) {\n this.children.forEach(child => {\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n child.__cancelCache(recursion);\n }\n });\n }\n }\n\n // 深度遍历执行所有子节点,包含自己,如果cb返回true,提前跳出不继续深度遍历\n deepScan(cb, options) {\n if(super.deepScan(cb, options)) {\n return;\n }\n this.children.forEach(node => {\n node.deepScan(cb, options);\n });\n }\n\n get children() {\n return this.__children;\n }\n\n get flowChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Text || item.currentStyle.position !== 'absolute';\n });\n }\n\n get absChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Xom && item.currentStyle.position === 'absolute';\n });\n }\n\n get zIndexChildren() {\n let flow = [];\n let abs = [];\n let needSort = false;\n let lastIndex;\n this.children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 不是遮罩,并且已有computedStyle,特殊情况下中途插入的节点还未渲染\n if(!item.isMask && !item.isClip && item.computedStyle) {\n if(item instanceof Xom) {\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__iIndex = i;\n let z = child.__zIndex = item.currentStyle.zIndex;\n abs.push(child);\n if(lastIndex === undefined) {\n lastIndex = z;\n }\n else if(!needSort) {\n if(z < lastIndex) {\n needSort = true;\n }\n lastIndex = z;\n }\n }\n else {\n flow.push(child);\n }\n }\n else {\n flow.push(child);\n }\n }\n });\n needSort && abs.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n return a.__iIndex - b.__iIndex;\n });\n return flow.concat(abs);\n }\n\n get lineGroups() {\n return this.__lineGroups;\n }\n\n get baseLine() {\n let len = this.lineGroups.length;\n if(len) {\n let last = this.lineGroups[len - 1];\n return last.y - this.y + last.baseLine;\n }\n return this.y;\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport transform from '../style/transform';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\n\nconst { AUTO } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {};\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = this.props.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.url = src;\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n }\n\n render(renderMode, ctx, defs) {\n super.render(renderMode, ctx, defs);\n let {\n sx: x, sy: y, width, height, isDestroyed,\n props: {\n src,\n },\n computedStyle: {\n display,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n }\n } = this;\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let originX = x + marginLeft + borderLeftWidth + paddingLeft;\n let originY = y + marginTop + borderTopWidth + paddingTop;\n let loadImg = this.__loadImg;\n if(loadImg.error) {\n let strokeWidth = Math.min(width, height) * 0.02;\n let stroke = '#CCC';\n let fill = '#DDD';\n let cx = originX + width * 0.7;\n let cy = originY + height * 0.3;\n let r = strokeWidth * 5;\n let pts = [\n [originX + width * 0.15, originY + height * 0.7],\n [originX + width * 0.3, originY + height * 0.4],\n [originX + width * 0.5, originY + height * 0.6],\n [originX + width * 0.6, originY + height * 0.5],\n [originX + width * 0.9, originY + height * 0.8],\n [originX + width * 0.15, originY + height * 0.8]\n ];\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.beginPath();\n ctx.moveTo(originX, originY);\n ctx.lineTo(originX + width, originY);\n ctx.lineTo(originX + width, originY + height);\n ctx.lineTo(originX, originY + height);\n ctx.lineTo(originX, originY);\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.virtualDom.children = [];\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(loadImg.url === src) {\n let source = loadImg.source;\n // 无source不绘制\n if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n this.virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!this.virtualDom.cache && list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n this.virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n this.virtualDom.conClip = 'url(#' + id + ')';\n delete this.virtualDom.cache;\n }\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n props.push(['transform', 'matrix(' + util.joinArr(matrix, ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n this.virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n }\n else {\n let loadImg = this.__loadImg;\n loadImg.url = src;\n loadImg.source = null;\n loadImg.error = null;\n loadImg.cache = false;\n inject.measureImg(src, data => {\n let self = this;\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.url && !self.__isDestroyed) {\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else {\n loadImg.error = true;\n }\n let { root, currentStyle: { width, height } } = self;\n root.delRefreshTask(self.__task);\n if(width.unit !== AUTO && height.unit !== AUTO) {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REPAINT,\n img: true,\n });\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行\n img: true, // 特殊标识强制布局即便没有style变化\n });\n },\n });\n }\n }\n }, {\n width,\n height,\n });\n }\n }\n\n get baseLine() {\n return this.height;\n }\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n }\n add(data) {\n data.uuid = 'karas-defs-' + this.id + '-' + this.count++;\n this.list.push(data);\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import util from './util';\nimport builder from './builder';\nimport $$type from './$$type';\n\nconst { TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n}\n\n/**\n * 检查cp是否有state变更\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制更新\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n check(cp.shadowRoot);\n }\n }\n else {\n check(cp.shadowRoot);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.__state = state;\n cp.__nextState = null;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = builder.flattenJson(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldSr, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n while(sr instanceof Component) {\n sr = sr.shadowRoot;\n }\n sr.__width = oldSr.width;\n sr.__height = oldSr.height;\n sr.__computedStyle = oldSr.computedStyle;\n sr.__layoutData = oldSr.layoutData;\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || json.$$type !== TYPE_PL) {\n removeList.push(oldSr);\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.inherit = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建\n // 否则需要强制触发组件更新,包含setState内容\n nj.$$type = TYPE_PL;\n nj.value = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n console.error('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList = [];\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n updateList,\n check,\n checkCp,\n did,\n};\n","import util from './util';\n\nconst { joinVd, joinDef } = util;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n diffBb(cns[1], ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n diffD2D(elem, ovd, nvd, true);\n}\n\nfunction diffDefs(elem, od, nd) {\n let ol = od.length;\n let nl = nd.length;\n let i = 0;\n let cns = elem.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffDef(cns[i], od[i], nd[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, mask, clip, filter, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(ovd.clip) {\n elem.removeAttribute('clip-path');\n }\n }\n if(ovd.clip !== clip) {\n if(clip) {\n elem.setAttribute('clip-path', clip);\n }\n else {\n elem.removeAttribute('clip-path');\n }\n if(ovd.mask) {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter) {\n if(filter) {\n elem.setAttribute('filter', filter);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n if(!nvd.cache) {\n diffX2X(elem, ovd, nvd);\n if(!root) {\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n }\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffChild(cns[i], ovd.children[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(lastChild, i, ovd.children[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb, oClip, nClip) {\n let ol = obb.length;\n let nl = nbb.length;\n if(oClip !== nClip) {\n if(!nClip) {\n elem.removeAttribute('clip-path');\n }\n else {\n elem.setAttribute('clip-path', nClip);\n }\n }\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n add(v) {\n if(this.__list.indexOf(v) === -1) {\n this.list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(list = this.__records) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(list.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n list.splice(0).forEach(item => {\n let { target, animate } = item;\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n }\n });\n }\n }\n\n __playAuto() {\n this.init(this.__auto);\n this.__action('play');\n }\n\n play(cb) {\n this.init();\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n cancel(cb) {\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n get list() {\n return this.__list;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Component from './Component';\nimport Defs from './Defs';\nimport mode from './mode';\nimport builder from '../util/builder';\nimport updater from '../util/updater';\nimport util from '../util/util';\nimport diff from '../util/diff';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport Controller from '../animate/Controller';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\n\nconst { isNil, isObject, isFunction } = util;\nconst { AUTO, PX, PERCENT } = unit;\nconst { calRelative, isRelativeOrAbsolute } = css;\n\nfunction getDom(dom) {\n if(util.isString(dom) && dom) {\n let o = document.querySelector(dom);\n if(!o) {\n throw new Error('Can not find dom of selector: ' + dom);\n }\n return o;\n }\n if(!dom) {\n throw new Error('Can not find dom: ' + dom);\n }\n return dom;\n}\n\nfunction renderProp(k, v) {\n let s = Array.isArray(v) ? util.joinSourceArray(v) : util.stringify(v);\n if(k === 'className') {\n k = 'class';\n }\n return ' ' + k + '=\"' + util.encodeHtml(s, true) + '\"';\n}\n\nfunction initEvent(dom) {\n ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(type => {\n dom.addEventListener(type, e => {\n let root = dom.__root;\n if(['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1) {\n root.__touchstartTarget.__emitEvent(root.__wrapEvent(e), true);\n }\n else {\n root.__cb(e);\n }\n });\n });\n}\n\n// 提取出对比节点尺寸是否修改,用currentStyle的对比computedStyle的\nfunction isFixedWidthOrHeight(node, k) {\n let c = node.currentStyle[k];\n let v = node.computedStyle[k];\n if(c.unit === PX) {\n return c.value === v;\n }\n if(c.unit === PERCENT) {\n let s = node.parent.layoutData[k === 'width' ? 'w' : 'h'];\n return c.value * s * 0.01 === v;\n }\n return false;\n}\nfunction isFixedSize(node) {\n return isFixedWidthOrHeight(node, 'width') && isFixedWidthOrHeight(node, 'height');\n}\n\nfunction findParentNotComponent(node, root) {\n if(node === root || !node) {\n return node;\n }\n if(node.host) {\n return findParentNotComponent(node.host, root);\n }\n return node.parent;\n}\n\nconst OFFSET = 0;\nconst LAYOUT = 1;\nfunction isLAYOUT(node, hash) {\n return node.hasOwnProperty('__uniqueReflowId') && hash[node.__uniqueReflowId] >= LAYOUT;\n}\n\nfunction setLAYOUT(node, hash) {\n addLAYOUT(node, hash);\n hash[node.__uniqueReflowId].lv |= LAYOUT;\n}\n\nlet __uniqueReflowId = 0;\nfunction addLAYOUT(node, hash) {\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n hash[__uniqueReflowId++] = {\n node,\n lv: LAYOUT,\n };\n }\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__cd = children || []; // 原始children,再初始化过程中生成真正的dom\n this.__dom = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n this.__sx = 1; // 默认缩放,css改变canvas/svg缩放后影响事件坐标\n this.__sy = 1;\n this.__task = [];\n this.__ref = {};\n this.__updateList = [];\n this.__reflowList = [{ node: this }]; // 初始化填自己,第一次布局时复用逻辑完全重新布局\n this.__animateController = new Controller();\n Event.mix(this);\n }\n\n __initProps() {\n let w = this.props.width;\n if(!isNil(w)) {\n let value = parseFloat(w) || 0;\n if(value > 0) {\n this.__width = value;\n }\n }\n let h = this.props.height;\n if(!isNil(h)) {\n let value = parseFloat(h) || 0;\n if(value > 0) {\n this.__height = value;\n }\n }\n this.__offScreen = !!this.props.offScreen;\n }\n\n __genHtml() {\n let res = `<${this.tagName}`;\n // 拼接处理属性\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n });\n res += `>`;\n return res;\n }\n\n __wrapEvent(e) {\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { dom, __sx, __sy } = this;\n let { x: x2, y: y2, left, top } = dom.getBoundingClientRect();\n x = x2 || left || 0;\n y = y2 || top || 0;\n let { pageX, pageY } = e.touches ? e.touches[0] : e;\n x = pageX - x;\n y = pageY - y;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标\n if(__sx !== 1) {\n x /= __sx;\n }\n if(__sy !== 1) {\n y /= __sy;\n }\n }\n return {\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n e.stopPropagation();\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n e.stopImmediatePropagation();\n },\n preventDefault() {\n e.preventDefault();\n },\n x,\n y,\n __hasEmitted: false,\n };\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接响应\n __cb(e) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let data = this.__wrapEvent(e);\n this.__emitEvent(data);\n return data;\n }\n\n appendTo(dom) {\n dom = getDom(dom);\n this.__children = builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n // 已有root节点\n if(dom.nodeName.toUpperCase() === this.tagName.toUpperCase()) {\n this.__dom = dom;\n if(this.width) {\n dom.setAttribute('width', this.width);\n }\n if(this.height) {\n dom.setAttribute('height', this.height);\n }\n }\n // 没有canvas/svg节点则生成一个新的\n else {\n this.__dom = dom.querySelector(this.tagName);\n if(!this.__dom) {\n dom.innerHTML = this.__genHtml();\n this.__dom = dom.querySelector(this.tagName);\n }\n }\n this.__uuid = isNil(this.__dom.__uuid) ? uuid++ : this.__dom.__uuid;\n this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid);\n // 没有设置width/height则采用css计算形式\n if(!this.width || !this.height) {\n let css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root) {\n this.dom.__root.destroy();\n }\n else {\n initEvent(this.dom);\n this.dom.__uuid = this.__uuid;\n }\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,一般是同步,为了防止外部因素inject是异步写成了cb形式\n inject.measureText(() => {\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS) {\n this.__clear(ctx);\n }\n this.render(renderMode, ctx, defs);\n if(renderMode === mode.SVG) {\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__root) {\n diff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH);\n });\n }\n\n destroy() {\n this.__destroy();\n frame.offFrame(this.__rTask);\n let n = this.dom;\n if(n) {\n n.__root = null;\n }\n }\n\n scale(x = 1, y = x) {\n this.__sx = x;\n this.__sy = y;\n }\n\n addRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task, renderMode, ctx } = this;\n // 第一个添加延迟侦听,后续放队列等待一并执行\n if(!task.length) {\n let clone;\n frame.nextFrame(this.__rTask = {\n before: diff => {\n clone = task.splice(0);\n // 前置一般是动画计算此帧样式应用,然后刷新后出发frame事件,图片加载等同\n if(clone.length) {\n let setStateList = [];\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.before)) {\n // 收集组件setState的更新,特殊处理\n if(item.__state) {\n setStateList.push(i);\n }\n item.before(diff);\n }\n });\n // 刷新前先进行setState检查,全都是setState触发的且没有更新则无需刷新\n if(setStateList.length) {\n updater.check(this);\n }\n // 有组件更新,则需要重新布局\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let sr = cp.shadowRoot;\n while(sr instanceof Component) {\n sr = sr.shadowRoot;\n }\n this.__addUpdate({\n node: sr,\n style: sr.currentStyle,\n focus: level.REFLOW,\n measure: true, // 未知强制measure\n });\n });\n this.refresh();\n }\n // 有可能组件都不需要更新,且没有其它触发的渲染更新\n else if(clone.length > setStateList.length) {\n this.refresh();\n }\n // 避免重复刷新,在frame每帧执行中,比如图片进行了异步刷新,动画的hook就可以省略再刷新一次\n let r = this.__hookTask;\n if(r) {\n let hookTask = frame.__hookTask;\n let i = hookTask.indexOf(r);\n if(i > -1) {\n hookTask.splice(i, 1);\n }\n }\n // 触发didUpdate\n updater.did();\n }\n },\n after: diff => {\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n }\n if(task.indexOf(cb) === -1) {\n task.push(cb);\n }\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n if(task[i] === cb) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n frame.offFrame(this.__rTask);\n }\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param width\n * @param height\n * @private\n */\n __checkRoot(width, height) {\n let { currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle.display) === -1) {\n computedStyle.display = currentStyle.display = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle.positoin === 'absolute') {\n computedStyle.position = currentStyle.positoin = 'static';\n }\n // 根节点满宽高\n currentStyle.width = {\n value: width,\n unit: PX,\n };\n currentStyle.height = {\n value: height,\n unit: PX,\n };\n computedStyle.width = width;\n computedStyle.height = height;\n // 继承值变默认,提前处理以便子节点根据parent计算\n css.computeMeasure(this, true);\n }\n\n __addUpdate(o) {\n this.__updateList.push(o);\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let { __updateList: updateList } = this;\n let hasUpdate;\n // 先按node合并所有样式的更新,一个node可能有多次更新调用,每个node临时生成一个更新id和更新style合集\n let totalList = [];\n let totalHash = {};\n let uniqueUpdateId = 0;\n updateList.forEach(item => {\n let { node, style, origin, overwrite, focus, img, measure } = item;\n // 事件队列和setState等原因,可能node已经销毁\n if(node.isDestroyed) {\n return;\n }\n if(!node.hasOwnProperty('__uniqueUpdateId')) {\n node.__uniqueUpdateId = uniqueUpdateId;\n totalHash[uniqueUpdateId++] = {\n node,\n style: {},\n focus,\n img,\n measure,\n };\n totalList.push(node);\n }\n // updateStyle()这样的调用还要计算normalize\n if(origin && style) {\n style = css.normalize(style);\n }\n // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复\n if(overwrite && style) {\n Object.assign(node.__style, style);\n }\n if(style) {\n Object.assign(totalHash[node.__uniqueUpdateId].style, style);\n }\n });\n // 此时做root检查,防止root出现继承等无效样式\n this.__checkRoot(width, height);\n // 合并完后按node计算更新的结果,无变化/reflow/repaint等级\n let measureList = [];\n let reflowList = [];\n for(let i = 0, len = totalList.length; i < len; i++) {\n let node = totalList[i];\n let { tagName, __uniqueUpdateId, currentStyle, currentProps, __cacheStyle = {}, __cacheProps = {} } = node;\n let lv = level.NONE;\n let p;\n let { style, focus, img, measure } = totalHash[__uniqueUpdateId];\n if(img) {\n lv |= level.REPAINT;\n }\n let hasMeasure = measure;\n let hasZ;\n for(let k in style) {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n // 只有geom的props和style2种可能\n if(change.isGeom(tagName, k)) {\n if(!css.equalStyle(k, v, currentProps[k], node)) {\n hasUpdate = true;\n this.renderMode === mode.SVG && node.__cancelCacheSvg();\n p = p || {};\n p[k] = style[k];\n lv |= level.REPAINT;\n __cacheProps[k] = undefined;\n }\n }\n else {\n if(k === 'zIndex') {\n hasZ = true;\n }\n // 需和现在不等,且不是pointerEvents这种无关的\n if(!css.equalStyle(k, v, currentStyle[k], node)) {\n this.renderMode === mode.SVG && node.__cancelCacheSvg();\n // pointerEvents这种无关的只需更新\n if(change.isIgnore(k)) {\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n else {\n hasUpdate = true;\n // 只粗略区分出none/repaint/reflow,repaint细化等级在后续,reflow在checkReflow()\n lv |= level.getLevel(k);\n if(change.isMeasure(k)) {\n hasMeasure = true;\n }\n // repaint置空,如果reflow会重新生成空的\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n }\n }\n }\n }\n if(p) {\n Object.assign(currentProps, p);\n }\n if(style) {\n Object.assign(currentStyle, style);\n }\n if(focus !== undefined) {\n hasUpdate = true;\n lv = level.focus;\n }\n // 无需任何改变处理的去除记录,如pointerEvents\n if(lv === level.NONE) {\n delete node.__uniqueUpdateId;\n totalList.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // reflow/repaint/measure相关的记录下来\n let isRepaint = level.isRepaint(lv);\n if(isRepaint) { console.log(node.tagName);\n // zIndex变化需清空svg缓存\n if(hasZ && renderMode === mode.SVG) {\n node.__cancelCacheSvg(true);\n }\n else {\n node.__cancelCacheSvg();\n }\n // TODO: repaint级别在node有缓存对象时赋予它,没有说明无缓存无作用\n // if(node.__cache) {\n // node.__cache.lv = level.getDetailLevel(style, lv);\n // }\n }\n // reflow在root的refresh中做\n else {\n reflowList.push({\n node,\n style,\n img,\n });\n // measure需要提前先处理\n if(hasMeasure) {\n measureList.push(node);\n }\n }\n }\n this.__updateList = [];\n // 没有更新的内容返回true\n if(!hasUpdate) {\n totalList.forEach(node => {\n delete node.__uniqueUpdateId;\n });\n return true;\n }\n this.__reflowList = reflowList;\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __uniqueUpdateId, parent } = node;\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n let last = node;\n // 检查measure的属性是否是inherit\n let isInherit = change.isMeasureInherit(totalHash[__uniqueUpdateId].style);\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent) {\n let { __uniqueUpdateId, currentStyle } = parent;\n let style = totalHash[__uniqueUpdateId];\n let isInherit;\n if(parent.hasOwnProperty('__uniqueUpdateId')) {\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n temp.forEach(k => {\n currentStyle[k] = style[k];\n // 已经赋值过的删除避免重复\n delete style[k];\n });\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承,一定不会有root,因为root已前置checkRoot()\n parent = findParentNotComponent(parent, this);\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.hasOwnProperty('__uniqueUpdateId')) {\n measureHash[target.__uniqueUpdateId] = true;\n }\n });\n });\n totalList.forEach(node => {\n delete node.__uniqueUpdateId;\n });\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响后面兄弟和父resize\n * 当flex变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响所有递归子节点和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 一般需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n let root = this;\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n\n // 单独提出共用检测影响的函数,非absolute和relative的offset情况从节点本身开始向上分析影响\n function checkInfluence(node) {\n // 自身尺寸固定且无变化,无需向上查找\n if(isFixedSize(node)) {\n return;\n }\n // cp强制刷新\n if(node instanceof Component) {\n return;\n }\n let target = node;\n // inline新老都影响,节点变为最近的父非inline\n if(node.currentStyle.display === 'inline' || node.computedStyle.display === 'inline') {\n let parent = findParentNotComponent(node, root);\n do {\n target = parent;\n // 父到root提前跳出\n if(parent === root) {\n return true;\n }\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 遇到absolute跳出,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 父固定宽度跳出直接父进行LAYOUT即可\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 继续向上\n parent = findParentNotComponent(parent, root);\n }\n while(parent && (parent.currentStyle.display === 'inline' || parent.computedStyle.display === 'inline'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果原本是inline则是其非inline父\n let parent = target.parent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 检查flex,如果父是flex,向上查找flex顶点视作其更改\n if(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex')) {\n do {\n target = parent;\n if(parent === root) {\n return true;\n }\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n parent = findParentNotComponent(parent, root);\n }\n while(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果父原本是flex则是其最上flex父\n parent = target.parent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 向上查找了并且没提前跳出的,父重新布局\n if(target !== node) {\n setLAYOUT(target, reflowHash);\n }\n }\n\n // TODO text变parent dom\n\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let { node, style, img } = reflowList[i];\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n let { currentStyle, computedStyle } = node;\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = {\n node,\n lv: OFFSET,\n };\n }\n let o = reflowHash[node.__uniqueReflowId];\n // absolute无变化,只影响自己\n if(currentStyle.position === 'absolute' && computedStyle.position === 'absolute') {\n o.lv = LAYOUT;\n }\n // absolute和非absolute互换\n else if(currentStyle.position !== computedStyle.position) {\n o.lv = LAYOUT;\n if(checkInfluence(node)) {\n hasRoot = true;\n break;\n }\n }\n // 所有其它变化\n else {\n let keys = Object.keys(style);\n let onlyXY = true;\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n if(k !== 'left' && k !== 'top' && k !== 'right' && k !== 'bottom') {\n onlyXY = false;\n break;\n }\n }\n // relative只有x/y变化时特殊只进行OFFSET,非relative的忽视掉这个无用影响\n if(onlyXY && !img) {\n if(computedStyle.position === 'relative') {\n o.lv |= OFFSET;\n }\n }\n // 剩余的其它变化\n else {\n o.lv = LAYOUT;\n if(checkInfluence(node)) {\n hasRoot = true;\n break;\n }\n }\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n return [reflowList, [{\n node: this,\n lv: LAYOUT,\n }]];\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n let uniqueList = [];\n this.deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n delete node.__uniqueReflowId; // 清除掉\n if(o.lv >= LAYOUT) {\n options.uniqueList.push(o);\n }\n else {\n // OFFSET的话先递归看子节点,本身改变放在最后\n let uniqueList = [];\n node.deepScan(function(child, uniqueList) {}, { uniqueList });\n uniqueList.push(o);\n options.uniqueList = options.uniqueList.concat(uniqueList);\n\n }\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n // 按顺序执行列表即可,上层LAYOUT先执行停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n uniqueList.forEach(item => {\n let { node, lv } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n if(lv >= LAYOUT) {\n let isLastAbs = node.computedStyle.position === 'absolute';\n let isNowAbs = node.currentStyle.position === 'absolute';\n let parent = findParentNotComponent(node, root);\n let { layoutData: { x, y, w, h }, width, ox, oy, computedStyle } = parent;\n let ref;\n if(ref = node.prev) {\n y = ref.y;\n y += ref.outerHeight;\n }\n else {\n y = parent.y;\n y += computedStyle.marginTop + computedStyle.borderTopWidth + computedStyle.paddingTop;\n }\n x += computedStyle.marginLeft + computedStyle.borderLeftWidth + computedStyle.paddingLeft;\n let { outerWidth, outerHeight } = node;\n if(isNowAbs) {\n // 找到最上层容器\n let container = parent;\n while(container) {\n if(isRelativeOrAbsolute) {\n break;\n }\n container = container.parent; // TODO\n }\n if(!container) {\n container = root;\n }\n parent.__layoutAbs(container, null, node);\n // 一直abs无需偏移后面兄弟\n if(isLastAbs) {\n return;\n }\n }\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n }\n // 记录重新布局引发的差值w/h\n let { outerWidth: ow, outerHeight: oh } = node;\n let dx = ow - outerWidth;\n let dy = oh - outerHeight;\n // 如果parent是relative,需再次累加ox/oy,无需向上递归,因为parent已经包含了\n if(computedStyle.position === 'relative') {\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n }\n // 如果有差值,递归向上所有parent需要扩充,直到absolute的中止\n if(dx || dy) {\n do {\n let { currentStyle } = parent;\n if(dx) {\n let need;\n // width在block不需要,parent一定不会是flex/inline\n if(currentStyle.positoin === 'absolute') {\n if(currentStyle.width.unit === AUTO\n && (currentStyle.left.unit === AUTO || currentStyle.right.unit === AUTO)) {\n need = true;\n }\n }\n }\n if(dy) {\n let need;\n if(currentStyle.positoin === 'absolute') {\n if(currentStyle.height.unit === AUTO\n && (currentStyle.top.unit === AUTO || currentStyle.bottom.unit === AUTO)) {\n need = true;\n }\n }\n // height则需要\n else if(currentStyle.height.unit === AUTO) {\n need = true;\n }\n if(need) {\n parent.__resizeY(dy);\n parent.__cancelCache(true);\n }\n }\n if(currentStyle.positoin === 'absolute') {\n break;\n }\n parent = findParentNotComponent(parent);\n }\n while(parent);\n }\n if(dy) {\n // 后面兄弟如果非absolute或非LAYOUT则offsetY\n let next = node.next;\n while(next) {\n if(next.currentStyle.position !== 'absolute'\n || !next.hasOwnProperty('____uniqueReflowId')\n || reflowHash[next.____uniqueReflowId].lv < LAYOUT) {\n next.__offsetY(dy, true);\n next.layoutData.y += dy;\n next.__cancelCache(true);\n }\n next = next.next;\n }\n }\n }\n // OFFSET操作的节点都是relative,要考虑auto变化\n else {\n let {\n currentStyle: { top, right, bottom, left }, currentStyle,\n computedStyle: { top: t, right: r, bottom: b, left: l }, computedStyle,\n } = node;\n let parent;\n if(node === this) {\n parent = node;\n }\n else {\n parent = findParentNotComponent(node, root);\n }\n let newY = 0;\n if(top.unit !== AUTO) {\n newY = calRelative(currentStyle, 'top', top, parent);\n computedStyle.top = newY;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n newY = -calRelative(currentStyle, 'bottom', bottom, parent);\n computedStyle.bottom = -newY;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n let oldY = 0;\n if(t !== 'auto') {\n oldY = t;\n }\n else if(b !== 'auto') {\n oldY = -b;\n }\n if(newY !== oldY) {\n node.__offsetY(newY - oldY);\n }\n let newX = 0;\n if(left.unit !== AUTO) {\n newX = calRelative(currentStyle, 'left', left, parent);\n computedStyle.left = newX;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n newX = -calRelative(currentStyle, 'right', right, parent);\n computedStyle.right = -newX;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n let oldX = 0;\n if(l !== 'auto') {\n oldX = l;\n }\n else if(r !== 'auto') {\n oldX = -r;\n }\n if(newX !== oldX) {\n node.__offsetX(newX - oldX);\n }\n }\n });\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n return [reflowList, uniqueList];\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n __frameHook() {\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n let r = this.__hookTask = this.__hookTask || (() => {\n this.refresh();\n });\n if(frame.__hookTask.indexOf(r) === -1) {\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n\n get dom() {\n return this.__dom;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get offScreen() {\n return this.__offScreen;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get task() {\n return this.__task;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n}\n\nexport default Root;\n","import Xom from '../node/Xom';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport mode from '../node/mode';\nimport util from '../util/util';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { int2rgba, isNil } = util;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__isMask = !!this.props.mask;\n this.__isClip = !!this.props.clip;\n let { style, isMask, isClip } = this;\n if(isMask || isClip) {\n style.visibility = 'visible';\n style.background = null;\n style.border = null;\n style.strokeWidth = 0;\n style.stroke = null;\n if(isClip) {\n style.fill = '#FFF';\n style.opacity = 1;\n }\n }\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n this.__cacheProps = {};\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n return w;\n }\n\n __calAutoBasis(isDirectionRow) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit !== AUTO) {\n b = max += main.value;\n }\n // border也得计算在内\n if(isDirectionRow) {\n let w = borderRightWidth + borderLeftWidth;\n b += w;\n max += w;\n min += w;\n }\n else {\n let h = borderTopWidth + borderBottomWidth;\n b += h;\n max += h;\n min += h;\n }\n return { b, min, max };\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__marginAuto(this.currentStyle, data);\n this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n this.__width = fixedWidth ? w : x - data.x;\n this.__height = fixedHeight ? h : y - data.y;\n this.__cacheProps = {};\n }\n\n __preRender(renderMode, ctx, defs) {\n let { sx: x, sy: y, width, height, __cacheStyle, currentStyle, computedStyle } = this;\n let {\n borderTopWidth,\n borderLeftWidth,\n display,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n visibility,\n } = computedStyle;\n let originX = x + borderLeftWidth + marginLeft + paddingLeft;\n let originY = y + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n let iw = width + paddingLeft + paddingRight;\n let ih = height + paddingTop + paddingBottom;\n // 先根据cache计算需要重新计算的computedStyle\n if(__cacheStyle.stroke === undefined) {\n let stroke = currentStyle.stroke;\n computedStyle.stroke = stroke;\n if(stroke && (stroke.k === 'linear' || stroke.k === 'radial')) {\n __cacheStyle.stroke = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, stroke);\n }\n else {\n __cacheStyle.stroke = int2rgba(currentStyle.stroke);\n }\n }\n if(__cacheStyle.fill === undefined) {\n let fill = currentStyle.fill;\n computedStyle.fill = fill;\n if(fill && (fill.k === 'linear' || fill.k === 'radial')) {\n __cacheStyle.fill = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, fill);\n }\n else {\n __cacheStyle.fill = int2rgba(currentStyle.fill);\n }\n }\n if(__cacheStyle.strokeWidth === undefined) {\n __cacheStyle.strokeWidth = true;\n let strokeWidth = currentStyle.strokeWidth;\n if(strokeWidth.unit === PX) {\n computedStyle.strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n computedStyle.strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n computedStyle.strokeWidth = 0;\n }\n }\n if(__cacheStyle.strokeWidth === undefined) {\n __cacheStyle.strokeWidth = true;\n let strokeWidth = currentStyle.strokeWidth;\n if(strokeWidth.unit === PX) {\n computedStyle.strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n computedStyle.strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n computedStyle.strokeWidth = 0;\n }\n }\n if(__cacheStyle.strokeDasharray === undefined) {\n __cacheStyle.strokeDasharray = true;\n computedStyle.strokeDasharray = currentStyle.strokeDasharray;\n __cacheStyle.strokeDasharrayStr = util.joinArr(currentStyle.strokeDasharray, ',');\n }\n // 直接赋值的\n [\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit'\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let {\n fill,\n stroke,\n strokeDasharrayStr,\n } = __cacheStyle;\n let {\n strokeWidth,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n strokeDasharray,\n } = computedStyle;\n if(renderMode === mode.CANVAS) {\n if(ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n if(ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n if(!util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n return {\n x,\n y,\n originX,\n originY,\n cx,\n cy,\n display,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n visibility,\n };\n }\n\n render(renderMode, ctx, defs) {\n super.render(renderMode, ctx, defs);\n if(renderMode === mode.SVG) {\n if(this.virtualDom.cache) {\n return {\n cache: true,\n };\n }\n this.virtualDom.type = 'geom';\n }\n let { isDestroyed, computedStyle: { display } } = this;\n if(isDestroyed || display === 'none') {\n return {\n isDestroyed,\n display,\n };\n }\n return this.__preRender(renderMode, ctx, defs);\n }\n\n __renderAsMask(renderMode, ctx, defs, isClip) {\n // mask渲染在canvas等被遮罩层调用,svg生成maskId\n if(renderMode === mode.SVG) {\n // 强制不缓存,防止引用mask的matrix变化不生效\n this.__cancelCacheSvg();\n this.render(renderMode, ctx, defs);\n let vd = this.virtualDom;\n if(isClip) {\n vd.isClip = true;\n }\n else {\n vd.isMask = true;\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n __cancelCache() {\n super.__cancelCache();\n this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n get baseLine() {\n return this.__height;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static getRegister(name) {\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return REGISTER.hasOwnProperty(name);\n }\n}\n\nexport default Geom;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length === 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length === 2) {\n num++;\n }\n if(controlB.length === 2) {\n num += 2;\n }\n return num;\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n }\n else {\n this.__x1 = this.__y1 = 0;\n this.__x2 = this.__y2 = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n display,\n visibility,\n originX,\n originY,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, x1, y1, x2, y2, controlA, controlB, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.x1)) {\n rebuild = true;\n __cacheProps.x1 = reBuild(x1, originX, width, isMulti);\n }\n if(isNil(__cacheProps.x2)) {\n rebuild = true;\n __cacheProps.x2 = reBuild(x2, originX, width, isMulti);\n }\n if(isNil(__cacheProps.y1)) {\n rebuild = true;\n __cacheProps.y1 = reBuild(y1, originY, height, isMulti);\n }\n if(isNil(__cacheProps.y2)) {\n rebuild = true;\n __cacheProps.y2 = reBuild(y2, originY, height, isMulti);\n }\n if(isNil(__cacheProps.controlA)) {\n rebuild = true;\n __cacheProps.controlA = reBuildC(controlA, originX, originY, width, height, isMulti);\n }\n if(isNil(__cacheProps.controlB)) {\n rebuild = true;\n __cacheProps.controlB = reBuildC(controlB, originX, originY, width, height, isMulti);\n }\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let curve = curveNum(ca, cb);\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n d = painter.svgLine(__cacheProps.x1, __cacheProps.y1, __cacheProps.x2, __cacheProps.y2,\n __cacheProps.controlA, __cacheProps.controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS) {\n if(strokeWidth > 0) {\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let curve = curveNum(ca, cb);\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n painter.canvasLine(ctx, __cacheProps.x1, __cacheProps.y1, __cacheProps.x2, __cacheProps.y2,\n __cacheProps.controlA, __cacheProps.controlB, curve);\n }\n ctx.stroke();\n ctx.closePath();\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get x1() {\n return this.getProps('x1');\n }\n get y1() {\n return this.getProps('y1');\n }\n get x2() {\n return this.getProps('x2');\n }\n get y2() {\n return this.getProps('y2');\n }\n get controlA() {\n return this.getProps('controlA');\n }\n get controlB() {\n return this.getProps('controlB');\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\n\nlet { isNil } = util;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, points, controls, __cacheProps, isMulti } = this;\n let rebuild = true;\n if(isNil(__cacheProps.points)) {\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n let pts = __cacheProps.points;\n let cls = __cacheProps.controls;\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n if(isMulti) {\n let list = pts.filter(item => Array.isArray(item)).map((item, i) => {\n let cl = cls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n list.forEach(item => d += painter.svgPolygon(item));\n __cacheProps.d = d;\n }\n }\n else {\n let list = pts.filter(item => Array.isArray(item)).map((point, i) => {\n if(i) {\n return concatPointAndControl(point, cls[i - 1]);\n }\n return point;\n });\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n let list = __cacheProps.list;\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get points() {\n return this.getProps('points');\n }\n get controls() {\n return this.getProps('controls');\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction getCoordsByDegree(x, y, r, d) {\n d = d % 360;\n if(d >= 0 && d < 90) {\n return [\n x + Math.sin(d * Math.PI / 180) * r,\n y - Math.cos(d * Math.PI / 180) * r\n ];\n }\n else if(d >= 90 && d < 180) {\n return [\n x + Math.cos((d - 90) * Math.PI / 180) * r,\n y + Math.sin((d - 90) * Math.PI / 180) * r,\n ];\n }\n else if(d >= 180 && d < 270) {\n return [\n x - Math.cos((270 - d) * Math.PI / 180) * r,\n y + Math.sin((270 - d) * Math.PI / 180) * r,\n ];\n }\n else {\n return [\n x - Math.sin((360 - d) * Math.PI / 180) * r,\n y - Math.cos((360 - d) * Math.PI / 180) * r,\n ];\n }\n}\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin)) {\n rebuild = true;\n __cacheProps.begin = begin;\n }\n if(isNil(__cacheProps.end)) {\n rebuild = true;\n __cacheProps.end = end;\n }\n if(isNil(__cacheProps.r)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n if(isNil(__cacheProps.edge)) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure)) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n // begin/end/r/edge/closure有变化就重建\n if(rebuild) {\n let { begin, end, r, closure } = __cacheProps;\n if(isMulti) {\n __cacheProps.x1 = [];\n __cacheProps.x2 = [];\n __cacheProps.y1 = [];\n __cacheProps.y2 = [];\n __cacheProps.large = [];\n __cacheProps.d = [];\n begin.forEach((begin, i) => {\n let r = isNil(r) ? width * 0.5 : r;\n let [x1, y1] = getCoordsByDegree(cx, cy, r, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r, end[i] || 0);\n let large = ((end[i] || 0) - begin) > 180 ? 1 : 0;\n __cacheProps.x1.push(x1);\n __cacheProps.x2.push(x2);\n __cacheProps.y1.push(y1);\n __cacheProps.y2.push(y2);\n __cacheProps.large.push(large);\n if(renderMode === mode.SVG) {\n __cacheProps.d.push(painter.svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge[i] || 0, closure[i]));\n }\n });\n }\n else {\n let [x1, y1] = getCoordsByDegree(cx, cy, r, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r, end);\n let large = (end - begin) > 180 ? 1 : 0;\n __cacheProps.x1 = x1;\n __cacheProps.x2 = x2;\n __cacheProps.y1 = y1;\n __cacheProps.y2 = y2;\n __cacheProps.large = large;\n if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let { begin, end, r, x1, y1, x2, y2, edge, large, closure } = __cacheProps;\n ctx.beginPath();\n if(isMulti) {\n begin.forEach((begin, i) => painter.canvasSector(ctx, cx, cy, r[i], x1[i], y1[i], x2[i], y2[i],\n strokeWidth, begin[i], end[i], large[i], edge[i], closure[i]));\n }\n else {\n painter.canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure);\n }\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n __cacheProps.d.map((item, i) => this.__genSector(__cacheProps.edge[i], item, fill, stroke, strokeWidth,\n strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit));\n }\n else {\n this.__genSector(__cacheProps.edge, __cacheProps.d, fill, stroke, strokeWidth,\n strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n }\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n get end() {\n return this.getProps('end');\n }\n get r() {\n return this.getProps('r');\n }\n get edge() {\n return this.getProps('edge');\n }\n get closure() {\n return this.getProps('closure');\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\nimport util from \"../util/util\";\n\nlet { isNil } = util;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n // rx/ry有变化需重建顶点\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n let list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n list.forEach(item => d += painter.svgPolygon(item));\n __cacheProps.d = d;\n }\n }\n else {\n let list = genVertex(originX, originY, width, height, rx, ry);\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let list = __cacheProps.list;\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get rx() {\n return this.getProps('rx');\n }\n get ry() {\n return this.getProps('ry');\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r)) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n let list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = '';\n list.forEach(item => __cacheProps.d += painter.svgPolygon(item));\n }\n }\n else {\n __cacheProps.r = r * width * 0.5;\n let list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let list = __cacheProps.list;\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get r() {\n return this.getProps('r');\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n // rx/ry有一个变了重新计算顶点\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n let list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = '';\n list.forEach(item => __cacheProps.d += painter.svgPolygon(item));\n }\n }\n else {\n let list = geom.ellipsePoints(cx, cy, rx, ry);\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let list = __cacheProps.list;\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get rx() {\n return this.getProps('rx');\n }\n get ry() {\n return this.getProps('ry');\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n};\n\nlet abbrCssProperty = {\n os: 'offset',\n e: 'easing',\n ft: 'filter',\n bd: 'boxShadow',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET).forEach(item => {\n let k = item.k;\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\n\nconst { TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(target, vars) {\n if(target && vars) {\n Object.keys(target).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = target[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n console.error('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 只需将可能存在的children在遍历link一遍即可,如果children里有递归,前面因为出现过已经link过了\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let { id, children } = item;\n if(Array.isArray(children)) {\n children.forEach(child => {\n // 排除原始类型文本\n if(!isPrimitive(child)) {\n let { libraryId } = child;\n // ide中库文件的child来自于库一定有libraryId,但是为了编程特殊需求,放开允许存入自定义数据\n if(isNil(libraryId)) {\n return;\n }\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,属性和子图层来自库\n if(libraryItem) {\n linkChild(child, libraryItem);\n }\n else {\n throw new Error('Link library item miss libraryId: ' + libraryId);\n }\n }\n });\n }\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, vars, hash = {}) {\n if(isPrimitive(json) || json instanceof Node) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, vars, hash);\n });\n }\n let { library, libraryId } = json;\n // 有library说明是个mc节点,不会有init/animate和children链接,是个正常节点\n if(Array.isArray(library)) {\n hash = {};\n // 强制要求library的文件是排好顺序的,即元件和被引用类型在前面,引用的在后面,\n // 另外没有循环引用,没有递归library,先遍历设置引用,再递归进行连接\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 删除以免二次解析,有library一定没libraryId\n json.library = null;\n json.libraryId = null;\n }\n // ide中库文件的child一定有libraryId,有library时一定不会有libraryId\n else if(!isNil(libraryId) && hash) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n }\n let { tagName, props = {}, children = [], animate = [], __animateRecords } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, vars);\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else {\n vd = karas.createVd(tagName, props, children.map((item, i) => {\n if(item && [TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, vars, hash);\n }));\n }\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n }\n let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport Controller from '../animate/Controller';\n\nexport default {\n parse(karas, json, dom, options = {}) {\n json = util.clone(json);\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options.vars);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__auto = ac.__auto.concat(animateRecords);\n ac.__playAuto();\n }\n else {\n ac.__records = ac.__records.concat(animateRecords);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n abbr,\n};\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\n\nexport default {\n css,\n reset,\n unit,\n font,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","export default {\n pointerEvents: true,\n};\n","import invalid from './invalid';\nimport level from './level';\nimport change from './change';\n\nexport default {\n invalid,\n level,\n change,\n};\n","import Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './geom/Geom';\nimport Line from './geom/Line';\nimport Polyline from './geom/Polyline';\nimport Polygon from './geom/Polygon';\nimport Sector from './geom/Sector';\nimport Rect from './geom/Rect';\nimport Circle from './geom/Circle';\nimport Ellipse from './geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n mode,\n Component,\n Geom,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\nupdater.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\n\nexport default karas;\n"],"names":["Node","__x","__y","__ox","__oy","__width","__height","__baseLine","__prev","__next","__parent","__root","__host","diff","isLayout","__isDestroyed","x","ox","y","oy","__virtualDom","CANVAS","SVG","canvasPolygon","ctx","list","length","n","moveTo","i","len","item","Array","isArray","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","s","canvasLine","x1","y1","x2","y2","controlA","controlB","num","svgLine","OFFSET","Math","PI","canvasSector","cx","cy","r","strokeWidth","begin","end","large","edge","closure","arc","stroke","svgSector","d","d2","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","identity","multiply","a","b","isPreIdA","isPreIdB","isSubIdA","isSubIdB","slice","c","calPoint","point","m","e","f","int2convolution","v","floor","sqrt","inverse","ar","br","cr","dr","er","fr","H","vectorProduct","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","max","min","angleBySide","theta","pow","acos","pointsDistance","triangleIncentre","x3","y3","ellipsePoints","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","matrix","computedStyle","width","height","transformOrigin","mx","calPercentInNode","ds","atan","d1","deg","Infinity","dt","cos","sin","d2r","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","bx","by","ax","ay","hx","hy","t","q","bboxBezier","arguments","h","calDeg","dx","dy","abs","rotate","pointIndex","points","index","cross","pointByIndex","res","j","push","exchangeOrder","source","target","sx1","sy1","sx2","sy2","sx3","sy3","tx1","ty1","tx2","ty2","tx3","ty3","isOverflow","cross1","cross2","transform","overflow","ls","geom","lt","alpha","ls2","lt2","ax2","ay2","ax3","ay3","ab","ac","bc","AB","AC","BC","A","tan","tar","TYPE_PL","_","TYPE_VD","TYPE_GM","TYPE_CP","toString","isType","type","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","isNil","undefined","joinSourceArray","arr","stringify","encodeHtml","prop","replace","joinVirtualDom","vd","defs","forEach","joinDef","bbClip","bb","joinVd","conClip","children","isMask","isClip","props","tagName","content","opacity","mask","clip","filter","def","uuid","joinItem","rgba2int","color","charAt","parseInt","match","parseFloat","int2rgba","joinArr","arr2hash","hash","Object","keys","k","hash2arr","clone","$$type","util","Date","equalArr","ai","bi","isArrayA","isArrayB","equal","hasOwnProperty","getTime","extend","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__target","assigning","assignCurrentStyle","isPrimitive","isAuto","unit","math","calSingle","calMatrix","ow","oh","normalize","calMatrixByOrigin","t2","calMatrixWithOrigin","pointInQuadrilateral","x4","y4","normalizeSingle","value","calOrigin","w","tfo","position","gradient","img","getLinearDeg","exec","getRadialPosition","data","test","top","left","center","right","bottom","getColorStop","p","start","per","prev","allBefore","allAfter","first","last","getCsLimit","next","c1","c2","getCsStartLimit","getCsEndLimit","calLinearCoords","calRadialRadius","shape","size","iw","ih","xl","yl","p1","p2","r1","g1","b1","a1","r2","g2","b2","a2","l1","l2","g","parseGradient","reg","o","toLowerCase","indexOf","z","map","getLinear","stop","getRadial","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","isLast","main1","main2","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","oyl","rx2","ry2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","concat","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btw","brw","bbw","blw","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","arial","lhr","car","blr","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","fontFamily","fontStyle","fontWeight","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","justifyContent","alignItems","textAlign","visibility","zIndex","translateX","translateY","scaleX","scaleY","skewX","skewY","rotateZ","boxShadow","pointerEvents","GEOM","fill","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","grow","shrink","basis","parseMarginPadding","key","temp","parseOneBorder","margin","padding","border","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","background","backgroundPosition","flex","translate","scale","skew","toFull","gd","repeat","bgc","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","KEY_EXPAND","EXPAND_HASH","IGNORE","REPAINT","MEASURE","isIgnore","isRepaint","isGeom","isMeasure","addGeom","ks","reset","MEASURE_KEY_SET","isMeasureInherit","measureInheritList","DEFAULT_FONT_SIZE","calUnit","compatibleTransform","abbr","console","error","arr1","arr2","isNaN","blur","computeMeasure","isHost","currentStyle","parent","parentComputedStyle","change","computeReflow","isRoot","calNormalLineHeight","setFontStyle","getBaseLine","normal","font","calRelativePercent","calRelative","isWidth","calAbsolute","equalStyle","oa","ob","av","bv","isMulti","isRelativeOrAbsolute","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","VERTEX","FRAGMENT","initShaders","gl","vshader","fshader","program","createProgram","useProgram","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","initVertexBuffers","vertices","Float32Array","vertexBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","FSIZE","BYTES_PER_ELEMENT","aPosition","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","aTexCoord","projectionMatrix","getUniformLocation","uniformMatrix3fv","initLocation","uSampler","uOffset","uClamp","createAndSetupTexture","texture","createTexture","bindTexture","TEXTURE_2D","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","KawaseBlurFilter","webgl","quality","pixelStorei","UNPACK_FLIP_Y_WEBGL","vertexLocations","textureLocations","_pixelSize","pixelSize","_kernels","_blur","textures","framebuffers","texImage2D","UNSIGNED_BYTE","fbo","createFramebuffer","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","image","uOffsetArray","clear","uniform2f","viewport","uniform4f","drawArrays","TRIANGLE_STRIP","initBuffers","uniform1i","originalImageTexture","canvas","uvX","uvY","offset","_quality","draw","clearRect","drawImage","kernels","step","clearColor","COLOR_BUFFER_BIT","apply","round","_generateKernels","gaussBlur","LineBox","__content","renderMode","cacheStyle","css","mode","fillText","Text","__lineBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","wait","MEASURE_TEXT","cache","CHAR_WIDTH_CACHE","sum","needMeasure","char","mw","charWidth","measureText","isVirtual","isDestroyed","lineBoxes","count","maxW","lineBox","__offsetX","__offsetY","textWidth","__layout","fillStyle","render","virtualDom","baseLine","__cacheStyle","prototype","__renderByMask","SPF","WEBGL","cacheCanvas","document","createElement","setAttribute","getContext","cacheWebgl","IMG","INIT","LOADING","LOADED","inject","html","chars","inline","div","body","appendChild","innerHTML","cns","childNodes","window","getComputedStyle","text","__measureCb","removeChild","measureImg","url","state","task","Image","onload","success","onerror","substr","host","location","hostname","crossOrigin","src","warn","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","getCacheCanvas","getCacheWebgl","isDom","Element","getElementsByTagName","Event","__eHash","handle","self","on","off","__karasEventCb","once","emit","event","fns","fn","traversal","before","after","isPause","Frame","__hookTask","__task","__now","__init","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","B","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","Error","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","unify","frames","currentProps","inherit","outerWidth","outerHeight","tf","genBeforeRefresh","frameStyle","animation","root","__addUpdate","__style","__assigning","__frameHook","framing","duration","es","time","transition","calDiff","pm","nm","pi","ni","pv","nv","innerWidth","eq","pp","np","v2","len2","pv2","nv2","v3","len3","pv3","nv3","calFrame","ts","binarySearch","frame","middle","getEasing","ea","timingFunction","steps","stepsD","percent","ceil","calIntermediateStyle","st","o2","n2","st2","gotoOverload","options","Animation","__id","__list","nl","__options","op","__duration","delay","endDelay","iterations","fps","playbackRate","__easing","playCount","spfLimit","__frames","__framesR","__startTime","currentTime","__nextTime","__fpsTime","__playState","current","unshift","copy","__keys","__originStyle","framesR","reverse","__clean","isFinish","__cancelTask","restore","__currentTime","__playCount","__stayEnd","__currentProps","__currentStyle","__cancelCacheSvg","__fin","__begin","__end","__isDelay","__finish","__inFps","__enterFrame","FINISH","__frameCb","isDelay","FRAME","__firstPlay","PLAY","__playCb","playState","firstEnter","stayEnd","stayBegin","__stayBegin","enterFrame","__calDiffTime","currentFrames","alternate","isEven","isLastFrame","isLastCount","inEndDelay","__nextBegin","BEGIN","END","pending","PAUSE","play","addRefreshTask","CANCEL","__goto","isFrame","excludeDelay","finish","spf","animateController","add","remove","backwards","both","forwards","sync","removeControl","nextFrame","__delay","__endDelay","__fps","__iterations","__fill","__direction","__playbackRate","__spfLimit","ENUM","NONE","TRANSFORM","OPACITY","FILTER","TRANSFORM_OPACITY","TRANSFORM_FILTER","OPACITY_FILTER","TRANSFORM_OPACITY_FILTER","REFLOW","assign","getLevel","getDetailLevel","lv","gt","gte","lte","isReflow","painter","renderBorder","xom","beginPath","closePath","renderBgc","method","rect","borderRadiusKs","calBorderRadius","noRadius","half","calBackgroundSize","calBackgroundPosition","container","renderBoxShadow","spread","inset","box","save","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","empty","Xom","__tagName","__computedStyle","__listener","__refreshLevel","level","listener","__loadBgi","__mpWidth","mp","fromAbs","__layoutData","__mp","__layoutFlex","__layoutInline","__layoutBlock","__cacheSvg","__animateRecords","controller","autoPlay","__records","__auto","__playAuto","w2","h2","fixedWidth","fixedHeight","innerHeight","matrixCache","isScale","__matrix","loadBgi","delRefreshTask","focus","__gradient","__opacity","globalAlpha","renderMatrix","__svgMatrix","matrixEvent","__matrixEvent","setTransform","offScreen","bgX","bgY","needMask","xnl","xnr","ynt","ynb","needResize","hasMask","hasClip","globalCompositeOperation","isEmpty","sibling","mChildren","svgMatrix","ref","owner","__destroy","force","__stopPropagation","__stopImmediatePropagation","willResponseEvent","inThis","__touchstartTarget","vs","__getLg","__getRg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","os","hasChange","origin","overwrite","cancel","LineGroup","__calBaseLine","Dom","Img","Geom","Component","initRoot","cd","flattenJson","build","relation","initCp","json","klass","__children","getRegister","traverseJson","lastText","sr","shadowRoot","setUpdateFlag","cp","__hasUpdate","constructor","__ref","__state","__isMounted","__nextState","builder","__cd","__shadowRoot","componentDidMount","REFRESH","componentWillUnmount","__emitEvent","__computeMeasure","defineProperty","get","TAG_NAME","INLINE","BOLD","__lineGroups","block","none","tag","flowChildren","__tryLayInline","isDirectionRow","isRecursion","main","__calAutoBasis","min2","max2","__calMp","lineGroups","__preLayout","cw","lineGroup","fw","verticalAlign","horizonAlign","__marginAuto","growList","shrinkList","basisList","minList","growSum","shrinkSum","basisSum","maxSum","maxCross","child","between","around","log","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__layoutAbs","__renderAsMask","zIndexChildren","recursion","__cancelCache","deepScan","flow","needSort","lastIndex","__iIndex","__zIndex","sort","loadImg","__loadImg","originX","originY","pts","strokeStyle","lineWidth","__addGeom","Defs","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldSr","oldJson","diffSr","layoutData","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","multi","diffChildren","diffChild","removeCpFromOldTree","oc","nc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","firstChild","lastChild","obb","nbb","oClip","nClip","isText","svg","where","insertBefore","Controller","args","animate","init","__action","__set","getDom","dom","querySelector","renderProp","initEvent","addEventListener","__wrapEvent","__cb","isFixedWidthOrHeight","isFixedSize","findParentNotComponent","LAYOUT","isLAYOUT","__uniqueReflowId","setLAYOUT","addLAYOUT","Root","__dom","__mw","__mh","__sx","__sy","__updateList","__reflowList","__animateController","mix","__offScreen","getBoundingClientRect","touches","pageX","pageY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","toUpperCase","__genHtml","__uuid","__defs","getInstance","getPropertyValue","__ctx","__renderMode","refresh","destroy","isFirst","__checkRoot","__checkUpdate","__checkReflow","__clear","__vd","__rTask","setStateList","updater","measure","hookTask","positoin","hasUpdate","totalList","totalHash","uniqueUpdateId","__uniqueUpdateId","measureList","reflowList","__cacheProps","hasMeasure","hasZ","measureHash","isInherit","hasRoot","reflowHash","checkInfluence","onlyXY","uniqueList","isLastAbs","isNowAbs","__resizeY","____uniqueReflowId","l","newY","oldY","newX","oldX","REGISTER","__isMulti","__isMask","__isClip","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","__preRender","name","hasRegister","reBuild","base","reBuildC","curveNum","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","rebuild","curve","__propsStrokeStyle","getProps","concatPointAndControl","control","Polyline","__points","__controls","controls","isControl","__getPoints","cls","cl","Polygon","getCoordsByDegree","getR","dft","Sector","__r","__edge","__closure","__genSector","genVertex","rx","ry","Rect","__rx","__ry","Circle","Ellipse","fullCssProperty","abbrCssProperty","ft","bd","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","k2","fk","replaceVars","vars","join","linkLibrary","libraryId","libraryItem","linkChild","JSON","parse","karas","animateRecords","library","createGm","createVd","animationRecord","has","invalid","register","version","appendTo","createCp","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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js","sources":["src/node/Node.js","src/node/mode.js","src/util/painter.js","src/style/unit.js","src/math/matrix.js","src/math/geom.js","src/math/tar.js","src/math/index.js","src/util/$$type.js","src/util/util.js","src/style/transform.js","src/style/reg.js","src/style/gradient.js","src/style/border.js","src/style/font.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/style/image.js","src/style/blur.js","src/node/LineBox.js","src/node/Text.js","src/util/inject.js","src/util/Event.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/refresh/level.js","src/node/Xom.js","src/node/LineGroup.js","src/util/builder.js","src/node/Component.js","src/node/tag.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/node/Root.js","src/geom/Geom.js","src/geom/Line.js","src/geom/Polyline.js","src/geom/Polygon.js","src/geom/Sector.js","src/geom/Rect.js","src/geom/Circle.js","src/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/invalid.js","src/refresh/index.js","src/index.js"],"sourcesContent":["class Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__prev = null;\n this.__next = null;\n this.__parent = null;\n this.__root = null;\n this.__host = null;\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n }\n\n __destroy() {\n this.__isDestroyed = true;\n this.__parent = null;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n};\n","function canvasPolygon(ctx, list) {\n if(!list || !list.length) {\n return;\n }\n let n = 0;\n ctx.moveTo(list[0][0], list[0][1]);\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0], item[1]);\n n++;\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0], item[1], item[2], item[3]);\n n += 2;\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0], item[1], item[2], item[3], item[4], item[5]);\n n += 2;\n }\n }\n return n;\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let s = 'M' + list[0][0] + ',' + list[0][1];\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num) {\n ctx.moveTo(x1, y1);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0], controlA[1], controlB[0], controlB[1], x2, y2);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0], controlB[1], x2, y2);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0], controlA[1], x2, y2);\n return 2;\n }\n else {\n ctx.lineTo(x2, y2);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nconst OFFSET = Math.PI * 0.5;\n\nfunction canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure) {\n let n = 2;\n ctx.arc(cx, cy, r, begin * Math.PI / 180 - OFFSET, end * Math.PI / 180 - OFFSET);\n if(edge) {\n if(!large || !closure) {\n ctx.lineTo(cx, cy);\n n++;\n }\n ctx.lineTo(x1, y1);\n n++;\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n }\n else {\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n if(!large || !closure) {\n ctx.lineTo(cx, cy);\n n++;\n }\n ctx.lineTo(x1, y1);\n n++;\n }\n return n;\n}\n\nfunction svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure) {\n let d = closure && large\n ? ('M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z')\n : ('M' + cx + ',' + cy + 'L' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z');\n let d2;\n if(!edge || strokeWidth > 0) {\n d2 = 'M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2;\n }\n return [d, d2];\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasSector,\n svgSector,\n};\n","export default {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n};\n","// 生成3*3单位矩阵,css表达方法一维6位\nfunction identity() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n// 矩阵a*b,固定两个matrix都是长度6\nfunction multiply(a, b) {\n // 特殊情况优化\n let isPreIdA = a[0] === 1 && a[1] === 0 && a[2] === 0 && a[3] === 1;\n let isPreIdB = b[0] === 1 && b[1] === 0 && b[2] === 0 && b[3] === 1;\n let isSubIdA = a[4] === 0 && a[5] === 0;\n let isSubIdB = b[4] === 0 && b[5] === 0;\n if(isPreIdA && isSubIdA) {\n return b;\n }\n if(isPreIdB && isSubIdB) {\n return a;\n }\n if(isPreIdA && isPreIdB) {\n a = a.slice(0);\n a[4] += b[4];\n a[5] += b[5];\n return a;\n }\n else if(isPreIdA || isPreIdB) {\n let c = isPreIdA ? b.slice(0) : a.slice(0);\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n return c;\n }\n let c = [\n a[0] * b[0] + a[2] * b[1],\n a[1] * b[0] + a[3] * b[1],\n a[0] * b[2] + a[2] * b[3],\n a[1] * b[2] + a[3] * b[3],\n 0,\n 0,\n ];\n if(isSubIdA && isSubIdB) {\n }\n else if(isSubIdB) {\n c[4] = a[4];\n c[5] = a[5];\n }\n else {\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y] = point;\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n}\n\nfunction int2convolution(v) {\n let d = Math.floor(v * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n d *= 3;\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * @param m\n */\nfunction inverse(m) {\n let [a, b, c, d, e, f] = m;\n let ar = 1;\n let br = 0;\n let cr = 0;\n let dr = 1;\n let er = 0;\n let fr = 0;\n // 先检查a是否为0,强制a为1\n if(a === 0) {\n a = 1;\n c += 1;\n e += 1;\n ar = 2;\n cr = 1;\n er = 1;\n }\n // b/a=x,R2-R1*x,b为0可优化\n if(b !== 0) {\n let x = b / a;\n b = 0;\n d -= c * x;\n f -= e * x;\n br = -x;\n dr -= cr * x;\n fr -= er * x;\n }\n // R1/a,a为1可优化\n if(a !== 1) {\n a = 1;\n c /= a;\n ar /= a;\n cr /= a;\n er /= a;\n }\n // c/e=y,R1-R2*y,c为0可优化\n if(c !== 0) {\n let y = c / e;\n c = 0;\n e -= f * y;\n ar -= br * y;\n cr -= dr * y;\n er -= fr * y;\n }\n // 检查d是否为0,如果为0转成1,R2+1-R1\n if(d === 0) {\n d = 1;\n f += 1 - e;\n br += 1 - ar;\n dr += 1 - cr;\n fr += 1 - er;\n }\n // R2/d,d为1可优化\n else if(d !== 1) {\n f /= d;\n br /= d;\n dr /= d;\n fr /= d;\n d = 1;\n }\n // R1-R3*e,R2-R3*f,e/f为0可优化\n if(e !== 0) {\n er -= e;\n e = 0;\n }\n if(f !== 0) {\n fr -= f;\n f = 0;\n }\n return [ar, br, cr, dr, er, fr];\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n int2convolution,\n inverse,\n};\n","import mx from './matrix';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\n\n// 向量积\nfunction vectorProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(vectorProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y]\n ];\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { width, height, transformOrigin: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = mx.calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { width, height, transformOrigin: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - x * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n else if(arguments.length === 6) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\nexport default {\n vectorProduct,\n pointInPolygon,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n },\n angleBySide,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n};\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[4] = -sx1;\n m[5] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[4] = -tx1;\n n[5] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[3] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[2] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[3] = -m[3];\n m[5] = -m[5];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[4] = tx1;\n t[5] = ty1;\n m = matrix.multiply(t, m);\n return m;\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\n};\n","// 类型为引用防止json仿造\nconst TYPE_PL = { _: 0 };\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n TYPE_PL,\n};\n","import $$type from './$$type';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, mask, clip, filter } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n }\n else {\n res[0] = res[1] = res[2] = 0;\n }\n res[3] = 1;\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_PL\n || obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__target = nvd;\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍\n if(item.assigning) {\n item.assignCurrentStyle();\n }\n });\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n};\n\nexport default util;\n","import unit from '../style/unit';\nimport math from '../math/index';\nimport util from '../util/util';\n\nconst { PX, PERCENT } = unit;\nconst { matrix, geom } = math;\nconst { identity, calPoint, multiply } = matrix;\nconst { d2r, pointInPolygon } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === 'translateX') {\n t[4] = v;\n }\n else if(k === 'translateY') {\n t[5] = v;\n }\n else if(k === 'scaleX') {\n t[0] = v;\n }\n else if(k === 'scaleY') {\n t[3] = v;\n }\n else if(k === 'skewX') {\n v = d2r(v);\n t[2] = Math.tan(v);\n }\n else if(k === 'skewY') {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === 'rotateZ') {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n }\n else if(k === 'matrix') {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n }\n}\n\nfunction calMatrix(transform, ow, oh) {\n let list = normalize(transform, ow, oh);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n if(ox === 0 && oy === 0) {\n return m;\n }\n let t = identity();\n t[4] = ox;\n t[5] = oy;\n let res = multiply(t, m);\n let t2 = identity();\n t2[4] = -ox;\n t2[5] = -oy;\n res = multiply(res, t2);\n return res;\n}\n\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\n// 判断点是否在一个矩形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n [x1, y1] = calPoint([x1, y1], matrix);\n [x2, y2] = calPoint([x2, y2], matrix);\n [x3, y3] = calPoint([x3, y3], matrix);\n [x4, y4] = calPoint([x4, y4], matrix);\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\nfunction normalizeSingle(k, v, ow, oh) {\n if(k === 'translateX') {\n if(v.unit === PERCENT) {\n return v.value * ow * 0.01;\n }\n }\n else if(k === 'translateY') {\n if(v.unit === PERCENT) {\n return v.value * oh * 0.01;\n }\n }\n else if(k === 'matrix') {\n return v;\n }\n return v.value;\n}\n\nfunction normalize(transform, ow, oh) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item.unit === PX) {\n tfo.push(item.value);\n }\n else if(item.unit === PERCENT) {\n tfo.push(item.value * (i ? h : w) * 0.01);\n }\n });\n return tfo;\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n pointInQuadrilateral,\n};\n","export default {\n position: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","import util from '../util/util';\nimport unit from './unit';\nimport reg from './reg';\nimport geom from '../math/geom';\n\nconst { rgba2int, int2rgba, isNil } = util;\nconst { PX, PERCENT } = unit;\nconst { d2r } = geom;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /(-?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/%$/.test(data) || /px$/.test(data) || /^-?[\\d.]+$/.test(data)) {\n return {\n value: parseFloat(data),\n unit: /%/.test(data) ? PERCENT : PX,\n };\n }\n else {\n let res = {\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data],\n unit: PERCENT,\n };\n if(isNil(res.value)) {\n res.value = 50;\n }\n return res;\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length) {\n let list = [];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let c = int2rgba(item[0]);\n let p = item[1];\n if(p.unit === PERCENT) {\n list.push([c, p.value * 0.01]);\n }\n else {\n list.push([c, p.value / length]);\n }\n }\n else {\n list.push([int2rgba(item[0])]);\n }\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i + 1);\n break;\n }\n }\n for(let i = list.length - 1; i > 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i);\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或= 0; i--) {\n let item = list[i];\n let p = item[1];\n if(p > 0) {\n allBefore = false;\n }\n if(p < 1) {\n allAfter = false;\n }\n }\n if(allBefore) {\n list.splice(0, len - 1);\n list[0][1] = 0;\n }\n else if(allAfter) {\n list.splice(1);\n list[0][1] = 0;\n }\n // 部分在区间之外需复杂计算\n else {\n let first = list[0];\n let last = list[len - 1];\n // 只要2个的情况下就是首尾都落在外面\n if(len === 2) {\n if(first[1] < 0 && last[1] > 1) {\n getCsLimit(first, last, length);\n }\n }\n // 只有1个在外面的情况较为容易\n else {\n if(first[1] < 0) {\n let next = list[1];\n let c1 = rgba2int(first[0]);\n let c2 = rgba2int(next[0]);\n let c = getCsStartLimit(c1, first[1], c2, next[1], length);\n first[0] = 'rgba(' + c[0] + ',' + c[1] + ',' + c[2] + ',' + c[3] + ')';\n first[1] = 0;\n }\n if(last[1] > 1) {\n let prev = list[len - 2];\n let c1 = rgba2int(prev[0]);\n let c2 = rgba2int(last[0]);\n let c = getCsEndLimit(c1, prev[1], c2, last[1], length);\n last[0] = 'rgba(' + c[0] + ',' + c[1] + ',' + c[2] + ',' + c[3] + ')';\n last[1] = 1;\n }\n }\n }\n }\n // 防止精度计算溢出[0,1]\n list.forEach(item => {\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2) {\n // let size = 'farthest-corner';\n let cx, cy;\n if(position[0].unit === PX) {\n cx = x1 + position[0].value;\n }\n else {\n cx = x1 + position[0].value * iw * 0.01;\n }\n if(position[1].unit === PX) {\n cy = y1 + position[1].value;\n }\n else {\n cy = y1 + position[1].value * ih * 0.01;\n }\n let r;\n if(size === 'closest-side') {\n // 在边外特殊情况只有end颜色填充\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = 0;\n }\n else {\n let xl;\n let yl;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n } else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n } else {\n yl = y2 - cy;\n }\n r = Math.min(xl, yl);\n }\n }\n else if(size === 'closest-corner') {\n let xl;\n let yl;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n else if(size === 'farthest-side') {\n if(cx <= x1) {\n r = x1 - cx + iw;\n }\n else if(cx >= x2) {\n r = cx - x2 + iw;\n }\n else if(cy <= y1) {\n r = y1 - cy + ih;\n }\n else if(cx >= y2) {\n r = cy - y2 + ih;\n }\n else {\n let xl = Math.max(x2 - cx, cx - x1);\n let yl = Math.max(y2 - cy, cy - y1);\n r = Math.max(xl, yl);\n }\n }\n // 默认farthest-corner\n else {\n let xl;\n let yl;\n if(cx < x1 + iw * 0.5) {\n xl = x2 - cx;\n }\n else {\n xl = cx - x1;\n }\n if(cy < y1 + ih * 0.5) {\n yl = y2 - cy;\n }\n else {\n yl = cy - y1;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n return [r, cx, cy];\n}\n\n// 当linear-gradient的值超过[0,1]区间限制时,计算其对应区间1的值\nfunction getCsStartLimit(c1, p1, c2, p2, length) {\n let [ r1, g1, b1, a1 = 1 ] = c1;\n let [ r2, g2, b2, a2 = 1 ] = c2;\n let l1 = Math.abs(p1) * length;\n let l2 = p2 * length;\n let p = l1 / (l2 + l1);\n let r = Math.floor(r1 + (r2 - r1) * p);\n let g = Math.floor(g1 + (g2 - g1) * p);\n let b = Math.floor(b1 + (b2 - b1) * p);\n let a = a1 + (a2 - a1) * p;\n return [r, g, b, a];\n}\n\nfunction getCsEndLimit(c1, p1, c2, p2, length) {\n let [ r1, g1, b1, a1 = 1 ] = c1;\n let [ r2, g2, b2, a2 = 1 ] = c2;\n let l1 = p1 * length;\n let l2 = p2 * length;\n let p = (length - l1) / (l2 - l1);\n let r = Math.floor(r1 + (r2 - r1) * p);\n let g = Math.floor(g1 + (g2 - g1) * p);\n let b = Math.floor(b1 + (b2 - b1) * p);\n let a = a1 + (a2 - a1) * p;\n return [r, g, b, a];\n}\n\nfunction getCsLimit(first, last, length) {\n let c1 = rgba2int(first[0]);\n let c2 = rgba2int(last[0]);\n let [ r1, g1, b1, a1 = 1 ] = c1;\n let [ r2, g2, b2, a2 = 1 ] = c2;\n let l1 = Math.abs(first[1]) * length;\n let l2 = last[1] * length;\n let p = l1 / (l1 + l2);\n let r = Math.floor(r1 + (r2 - r1) * p);\n let g = Math.floor(g1 + (g2 - g1) * p);\n let b = Math.floor(b1 + (b2 - b1) * p);\n let a = a1 + (a2 - a1) * p;\n first[0] = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n first[1] = 0;\n p = (length + l1) / (l1 + l2);\n r = Math.floor(r1 + (r2 - r1) * p);\n g = Math.floor(g1 + (g2 - g1) * p);\n b = Math.floor(b1 + (b2 - b1) * p);\n a = a1 + (a2 - a1) * p;\n last[0] = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n last[1] = 1;\n}\n\nfunction parseGradient(s) {\n let gradient = reg.gradient.exec(s);\n if(gradient) {\n let o = {\n k: gradient[1],\n };\n if(o.k === 'linear') {\n let deg = /(-?[\\d.]+deg)|(to\\s+[toprighbml]+)/i.exec(gradient[2]);\n if(deg) {\n o.d = getLinearDeg(deg[0].toLowerCase());\n }\n else {\n o.d = 180;\n }\n }\n else if(o.k === 'radial') {\n o.s = gradient[2].indexOf('ellipse') > -1 ? 'ellipse' : 'circle';\n let size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]);\n if(size) {\n o.z = size[0].toLowerCase();\n }\n else {\n o.z = 'farthest-corner';\n }\n let position = /at\\s+((?:-?[\\d.]+(?:px|%)?)|(?:left|top|right|bottom|center))(?:\\s+((?:-?[\\d.]+(?:px|%)?)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [{\n value: 50,\n unit: PERCENT,\n }, {\n value: 50,\n unit: PERCENT,\n }];\n }\n }\n let v = gradient[2].match(/((#[0-9a-f]{3,6})|(rgba?\\(.+?\\)))\\s*(-?[\\d.]+(px|%))?/ig);\n o.v = v.map(item => {\n let res = /((?:#[0-9a-f]{3,6})|(?:rgba?\\(.+?\\)))\\s*(-?[\\d.]+(?:px|%))?/i.exec(item);\n let arr = [rgba2int(res[1])];\n if(res[2]) {\n arr[1] = {\n value: parseFloat(res[2]),\n };\n if(/%$/.test(res[2])) {\n arr[1].unit = PERCENT;\n }\n else {\n arr[1].unit = PX;\n }\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, cx, cy, w, h) {\n let theta = d2r(d);\n let length = Math.abs(w * Math.sin(theta)) + Math.abs(h * Math.cos(theta));\n let [x1, y1, x2, y2] = calLinearCoords(d, length * 0.5, cx, cy);\n let stop = getColorStop(v, length);\n return {\n x1,\n y1,\n x2,\n y2,\n stop,\n };\n}\n\nfunction getRadial(v, shape, size, position, x1, y1, x2, y2) {\n let w = x2 - x1;\n let h = y2 - y1;\n let [r, cx, cy] = calRadialRadius(shape, size, position, w, h, x1, y1, x2, y2);\n let stop = getColorStop(v, r * 2);\n // 超限情况等同于只显示end的bgc\n if(r <= 0) {\n let end = stop[stop.length - 1];\n end[1] = 0;\n stop = [end];\n cx = x1;\n cy = y1;\n // 肯定大于最长直径\n r = w + h;\n }\n return {\n cx,\n cy,\n r,\n stop,\n };\n}\n\nexport default {\n parseGradient,\n getLinear,\n getRadial,\n};\n","/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nimport geom from '../math/geom';\n\nconst { H } = geom;\n\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btw boderTopWidth\n * @param brw borderRightWidth\n * @param bbw borderBottomWidth\n * @param blw borderLeftWidth\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n // 先减去对应borderWidth,因为border可能比较宽,弧度只体现在外圆弧,有可能radius为0减去后为负数需判断\n btlx -= blw;\n btly -= btw;\n btrx -= brw;\n btry -= btw;\n bbrx -= brw;\n bbry -= bbw;\n bblx -= blw;\n bbly -= bbw;\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n};\n","'use strict';\n\nexport default {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n // lgr: 0.03271484375, // line-gap ratio,67/2048\n },\n // 'pingfang sc': {\n // lhr: 1.4, // (0+1060+340)/1000\n // car: 1.4, // (1060+340)/1000\n // blr: 1.06, // 1060/1000\n // },\n};\n","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'normal',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'stretch',\n textAlign: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n scaleX: 1,\n scaleY: 1,\n skewX: 0,\n skewY: 0,\n rotateZ: 0,\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(temp) {\n let match = temp.toString().match(/(-?[\\d.]+(px|%)?)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+px\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,6}/i.exec(v);\n if(c && [4, 7].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderWidthTop', 'borderWidthRight', 'borderWidthBottom', 'borderWidthLeft'],\n borderColor: ['borderColorTop', 'borderColorRight', 'borderColorBottom', 'borderColorLeft'],\n borderStyle: ['borderStyleTop', 'borderStyleRight', 'borderStyleBottom', 'borderStyleLeft'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundRepeat: ['backgroundRepeatX', 'backgroundRepeatY'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-)?repeat(-[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n this.toFull(style, 'backgroundRepeat');\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position[0];\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, Math.max(0, parseFloat(v)), 1, 0);\n }\n else if(/^[\\d.]+px$/i.test(v)) {\n parseFlex(style, 1, 1, 0);\n }\n else if(/^[\\d.]+%$/.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], arr[1], 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+%$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], 1, arr[1]);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n v = v.toString().split(/\\s+/);\n if(v.length === 1) {\n v[1] = '50%';\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[i];\n }\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n }\n};\n","const KEY_COLOR = [\n 'backgroundColor',\n 'borderBottomColor',\n 'borderLeftColor',\n 'borderRightColor',\n 'borderTopColor',\n 'color',\n];\n\nconst KEY_LENGTH = [\n 'fontSize',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'bottom',\n 'left',\n 'right',\n 'top',\n 'flexBasis',\n 'width',\n 'height',\n 'lineHeight',\n 'marginBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'strokeWidth',\n 'strokeMiterlimit',\n];\n\nconst KEY_GRADIENT = [\n 'backgroundImage',\n 'fill',\n 'stroke',\n];\n\nconst KEY_RADIUS = [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n};\n\nconst KEY_EXPAND = [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'rotateZ',\n 'skewX',\n 'skewY'\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\n\nlet o = {\n GEOM: {\n },\n IGNORE: {\n pointerEvents: true,\n },\n REPAINT: {\n transform: true,\n translateX: true,\n translateY: true,\n skewX: true,\n skewY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n color: true,\n fontStyle: true,\n strokeWidth: true,\n fill: true,\n strokeDasharray: true,\n strokeLinecap: true,\n strokeLinejoin: true,\n strokeMiterlimit: true,\n backgroundColor: true,\n backgroundImage: true,\n backgroundPositionX: true,\n backgroundPositionY: true,\n backgroundRepeat: true,\n backgroundSize: true,\n stroke: true,\n borderBottomColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomRightRadius: true,\n borderBottomLeftRadius: true,\n visibility: true,\n opacity: true,\n zIndex: true,\n filter: true,\n boxShadow: true,\n },\n MEASURE: {\n fontSize: true,\n fontWeight: true,\n fontFamily: true,\n },\n isIgnore(k) {\n return this.IGNORE.hasOwnProperty(k);\n },\n isRepaint(k) {\n return this.REPAINT.hasOwnProperty(k) || this.isGeom(k);\n },\n isMeasure(k) {\n return this.MEASURE.hasOwnProperty(k);\n },\n addGeom(tagName, ks) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k);\n });\n }\n else if(ks) {\n o.GEOM[ks] = tagName;\n }\n },\n isGeom(tagName, k) {\n return this.GEOM.hasOwnProperty(k) && this.GEOM[k] === tagName;\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(reset.DOM.hasOwnProperty(k)) {\n return true;\n }\n if(tagName.charAt(0) === '$' && reset.GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(this.GEOM.hasOwnProperty(k)) {\n return this.GEOM[k] === tagName;\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(o.MEASURE);\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n return true;\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls']);\no.addGeom('$polygon', ['points', 'controls']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport util from '../util/util';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING } = unit;\nconst { isNil, rgba2int } = util;\n\nconst DEFAULT_FONT_SIZE = 16;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\n/**\n * 通用的格式化计算数值单位的方法,百分比像素auto和纯数字,直接修改传入对象本身\n * @param obj 待计算的样式对象\n * @param k 对象的key\n * @param v 对象的value\n * @returns 格式化好的样式对象本身\n */\nfunction calUnit(obj, k, v) {\n if(v === 'auto') {\n obj[k] = {\n unit: AUTO,\n };\n }\n else if(v === 'inherit') {\n obj[k] = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PERCENT,\n };\n }\n else if(/px$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PX,\n };\n }\n else if(/deg$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: DEG,\n };\n }\n else {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: NUMBER,\n };\n }\n // border相关不能为负值\n if(k.toString().indexOf('border') === 0) {\n obj[k].value = Math.max(obj[k].value, 0);\n }\n return obj;\n}\n\nfunction compatibleTransform(k, v) {\n if(k.indexOf('scale') > -1) {\n v.unit = NUMBER;\n }\n else if(k.indexOf('translate') > -1) {\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n }\n else {\n if(v.unit === NUMBER) {\n v.unit = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式\n * @returns Object 标准化的样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n delete style.border;\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n delete style[k];\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n delete style.borderWidth;\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n delete style.borderColor;\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n delete style.borderStyle;\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n delete style.borderRadius;\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n delete style.background;\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n delete style.backgroundPosition;\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n delete style.flex;\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n delete style.margin;\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n delete style.padding;\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n console.error(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n temp = style.rotate;\n if(!isNil(temp)) {\n abbr.toFull(style, 'rotate');\n delete style.rotate;\n }\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp) {\n // 区分是渐变色还是图\n if(reg.gradient.test(temp)) {\n style.backgroundImage = gradient.parseGradient(temp);\n }\n else if(reg.img.test(temp)) {\n style.backgroundImage = reg.img.exec(temp)[2];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,6}/i.exec(temp);\n if(bgc && [4, 7].indexOf(bgc[0].length) > -1) {\n style.backgroundColor = {\n value: rgba2int(bgc[0]),\n unit: RGBA,\n };\n }\n else {\n bgc = /rgba?\\(.+\\)/i.exec(temp);\n style.backgroundColor = {\n value: rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]),\n unit: RGBA,\n };\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n if(/%$/.test(temp) || /px$/i.test(temp) || /^-?[\\d.]+$/.test(temp)) {\n calUnit(style, k, temp);\n temp = style[k];\n if(temp.unit === NUMBER) {\n temp.unit = PX;\n }\n }\n else {\n style[k] = {\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[temp],\n unit: PERCENT,\n };\n }\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n let bc = style.backgroundSize = [];\n let match = temp.toString().match(/\\b(?:(-?[\\d.]+(px|%)?)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(bc, i, item);\n if(bc[i].unit === NUMBER) {\n bc[i].unit = PX;\n }\n }\n else if(item === '0' || item === 0) {\n bc.push({\n value: 0,\n unit: PX,\n });\n }\n else if(item === 'contain' || item === 'cover') {\n bc.push({\n value: item,\n unit: STRING,\n });\n }\n else {\n bc.push({\n unit: AUTO,\n });\n }\n }\n }\n else {\n bc.push({\n unit: AUTO,\n });\n bc[1] = bc[0];\n }\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n style[k] = {\n value: rgba2int(v),\n unit: RGBA,\n };\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(arr, i, item);\n if(arr[i].unit === NUMBER) {\n arr[i].unit = PX;\n }\n }\n else {\n arr[i] = {\n value: 0,\n unit: PX,\n };\n }\n }\n style[k] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = style.transform = [];\n let match = temp.toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push(['matrix', arr]);\n }\n }\n else if({\n 'translateX': true,\n 'translateY': true,\n 'scaleX': true,\n 'scaleY': true,\n 'skewX': true,\n 'skewY': true,\n 'rotate': true,\n 'rotateZ': true,\n }.hasOwnProperty(k)) {\n if(k === 'rotate') {\n k = 'rotateZ';\n }\n let arr = calUnit([k, v], 1, v);\n compatibleTransform(k, arr[1]);\n transform.push(arr);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n let arr1 = calUnit([k + 'X', arr[0]], 1, arr[0]);\n let arr2 = calUnit([k + 'Y', arr[1]], 1, arr[1]);\n compatibleTransform(k, arr1[1]);\n compatibleTransform(k, arr2[1]);\n transform.push(arr1);\n transform.push(arr2);\n }\n });\n }\n }\n temp = style.transformOrigin;\n if(!isNil(temp)) {\n let tfo = style.transformOrigin = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(tfo, i, item);\n if(tfo[i].unit === NUMBER) {\n tfo[i].unit = PX;\n }\n }\n else {\n tfo.push({\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n unit: PERCENT,\n });\n // 不规范的写法变默认值50%\n if(isNil(tfo[i].value)) {\n tfo[i].value = 50;\n }\n }\n }\n }\n else {\n tfo.push({\n value: 50,\n unit: PERCENT,\n });\n tfo[1] = tfo[0];\n }\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n if(k === 'rotate') {\n k = 'rotateZ';\n style.rotateZ = style.rotate;\n delete style.rotate;\n }\n // 没有单位或默认值处理单位\n v = style[k];\n compatibleTransform(k, v);\n });\n temp = style.opacity;\n if(temp) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n style.opacity = temp;\n }\n else {\n style.opacity = 1;\n }\n }\n temp = style.zIndex;\n if(temp) {\n style.zIndex = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n 'flexBasis',\n 'strokeWidth',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n v = style[k];\n // 无单位视为px\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n });\n temp = style.color;\n if(temp) {\n if(temp === 'inherit') {\n style.color = {\n unit: INHERIT,\n };\n }\n else {\n style.color = {\n value: rgba2int(temp),\n unit: RGBA,\n };\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.fontSize = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(temp)) {\n let v = Math.max(0, parseFloat(temp));\n if(v) {\n style.fontSize = {\n value: v,\n unit: PERCENT,\n };\n }\n else {\n style.fontSize = {\n value: DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n else {\n style.fontSize = {\n value: Math.max(0, parseFloat(temp)) || DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n temp = style.fontWeight;\n if(temp || temp === 0) {\n if(temp === 'bold') {\n style.fontWeight = {\n value: 700,\n unit: NUMBER,\n };\n }\n else if(temp === 'normal') {\n style.fontWeight = {\n value: 400,\n unit: NUMBER,\n };\n }\n else if(temp === 'lighter') {\n style.fontWeight = {\n value: 200,\n unit: NUMBER,\n };\n }\n else if(temp === 'inherit') {\n style.fontWeight = {\n unit: INHERIT,\n };\n }\n else {\n style.fontWeight = {\n value: Math.max(0, parseInt(temp)) || 400,\n unit: NUMBER,\n };\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n style.fontStyle = {\n unit: INHERIT,\n };\n }\n else {\n style.fontStyle = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n style.fontFamily = {\n unit: INHERIT,\n };\n }\n else {\n style.fontFamily = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n style.textAlign = {\n unit: INHERIT,\n };\n }\n else {\n style.textAlign = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.lineHeight;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.lineHeight = {\n unit: INHERIT,\n };\n }\n else if(temp === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/px$/i.test(temp)) {\n style.lineHeight = {\n value: parseFloat(temp),\n unit: PX,\n };\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n else {\n style.lineHeight = {\n value: n,\n unit: NUMBER,\n };\n }\n }\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n style.strokeDasharray = match;\n }\n else {\n style.strokeDasharray = [];\n }\n }\n // fill和stroke为渐变时特殊处理\n temp = style.fill;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.fill = gradient.parseGradient(temp);\n }\n else {\n style.fill = rgba2int(temp);\n }\n }\n temp = style.stroke;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.stroke = gradient.parseGradient(temp);\n }\n else {\n style.stroke = rgba2int(temp);\n }\n }\n temp = style.filter;\n if(temp) {\n style.filter = [];\n let blur = /\\bblur\\s*\\(\\s*([\\d.]+)\\s*(?:px)?\\s*\\)/i.exec(temp);\n if(blur) {\n let v = parseFloat(blur[1]) || 0;\n if(v) {\n style.filter.push(['blur', v]);\n }\n }\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n style.visibility = {\n unit: INHERIT,\n };\n }\n else {\n style.visibility = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n style.pointerEvents = {\n unit: INHERIT,\n };\n }\n else {\n style.pointerEvents = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.boxShadow;\n if(temp) {\n style.boxShadow = [];\n let match = temp.match(/(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?\\s*)?(-?[\\d.]+(px)?\\s*)?(((transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n match.forEach(item => {\n let boxShadow = /(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?\\s*)?(-?[\\d.]+(?:px)?\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,6})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n let res = [boxShadow[1], boxShadow[2], boxShadow[3] || 0, boxShadow[4] || 0, boxShadow[5] || '#000', boxShadow[6] || 'outset'];\n for(let i = 0; i < 4; i++) {\n calUnit(res, i, res[i]);\n // x/y可以负,blur和spread不行,没有继承且只有px无需保存单位\n if(i > 1 && res[i].value < 0) {\n res[i] = 0;\n }\n if(res[i].unit === NUMBER) {\n res[i] = res[i].value;\n }\n }\n res[4] = rgba2int(res[4]);\n style.boxShadow.push(res);\n }\n });\n }\n return style;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let parentComputedStyle = !isHost && parent.computedStyle;\n change.MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n if(v.unit === INHERIT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v.unit === PERCENT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : (parentComputedStyle[k] * v.value * 0.01);\n }\n else {\n computedStyle[k] = v.value;\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let { textAlign, lineHeight } = currentStyle;\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ].forEach(k => {\n // border-width不支持百分比\n computedStyle[k] = currentStyle[k].unit === PX ? Math.max(0, currentStyle[k].value) : 0;\n });\n [\n 'position',\n 'display',\n 'flexDirection',\n 'justifyContent',\n 'alignItems',\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(textAlign.unit === INHERIT) {\n computedStyle.textAlign = isRoot ? 'left' : parentComputedStyle.textAlign;\n }\n else {\n computedStyle.textAlign = isRoot ? 'left' : textAlign.value;\n }\n if(lineHeight.unit === INHERIT) {\n computedStyle.lineHeight = isRoot ? calNormalLineHeight(computedStyle) : parentComputedStyle.lineHeight;\n }\n // 防止为0\n else if(lineHeight.unit === PX) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight.unit === NUMBER) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) * computedStyle.fontSize || calNormalLineHeight(computedStyle);\n }\n // normal\n else {\n computedStyle.lineHeight = calNormalLineHeight(computedStyle);\n }\n}\n\nfunction setFontStyle(style) {\n let { fontStyle, fontWeight, fontSize, fontFamily } = style;\n return (fontStyle || '') + ' ' + (fontWeight || '') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (fontFamily || '');\n}\n\nfunction getBaseLine(style) {\n let normal = style.fontSize * font.arial.lhr;\n return (style.lineHeight - normal) * 0.5 + style.fontSize * font.arial.blr;\n}\n\nfunction calNormalLineHeight(computedStyle) {\n return computedStyle.fontSize * font.arial.lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style.unit === AUTO) {\n if(k === 'width') {\n parent = parent.parent;\n }\n else {\n break;\n }\n }\n else if(style.unit === PX) {\n return n * style.value;\n }\n else if(style.unit === PERCENT) {\n n *= style.value * 0.01;\n parent = parent.parent;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v.value, parent, 'width');\n }\n else {\n v = calRelativePercent(v.value, parent, 'height');\n }\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n v = v.value * size * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === 'transform') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n if(oa === 'matrix') {\n if(!util.equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n else if(!util.equal(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === 'filter') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!util.equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === 'transformOrigin' || k === 'backgroundSize') {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a.value === b.value && a.unit === b.unit;\n }\n if(k === 'boxShadow') {\n return util.equalArr(a, b);\n }\n if(RADIUS_HASH.hasOwnProperty(k)) {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a.unit === b.unit && util.equalArr(a.value, b.value);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1].value !== bi[1].value || ai[1].unit !== bi[1].unit) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(change.isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return util.equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle.position;\n return position === 'relative' || position === 'absolute';\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n};\n","import unit from './unit';\nimport transform from './transform';\n\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n ['scaleX', {\n value: targetWidth / imgWidth,\n unit: NUMBER,\n }],\n ['scaleY', {\n value: targetHeight / imgHeight,\n unit: NUMBER,\n }]\n ];\n let tfo = transform.calOrigin([\n {\n value: 0,\n unit: PERCENT,\n },\n {\n value: 0,\n unit: PERCENT,\n }\n ], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","const VERTEX = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying vec2 vTextureCoord;\nuniform mat3 projectionMatrix;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}`;\n\nconst FRAGMENT = `\n#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}`;\n\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if (!program) {\n console.error('Failed to create program');\n return false;\n }\n\n gl.useProgram(program);\n gl.program = program;\n\n return true;\n}\n\nfunction createProgram(gl, vshader, fshader) {\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if (!vertexShader || !fragmentShader) {\n return null;\n }\n\n let program = gl.createProgram();\n if (!program) {\n return null;\n }\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if (!linked) {\n let error = gl.getProgramInfoLog(program);\n console.error('Failed to link program: ' + error);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n return null;\n }\n return program;\n}\n\nfunction loadShader(gl, type, source) {\n let shader = gl.createShader(type);\n if (shader == null) {\n console.error('unable to create shader');\n return null;\n }\n\n gl.shaderSource(shader, source);\n\n gl.compileShader(shader);\n\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!compiled) {\n let error = gl.getShaderInfoLog(shader);\n console.error('Failed to compile shader: ' + error);\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}\n\nfunction initVertexBuffers(gl) {\n let vertices = new Float32Array([\n -1, 1, 0.0, 1.0,\n -1, -1, 0.0, 0.0,\n 1, 1, 1.0, 1.0,\n 1, -1, 1.0, 0.0\n ]);\n let vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n let FSIZE = Float32Array.BYTES_PER_ELEMENT;\n let aPosition = gl.getAttribLocation(gl.program, 'aVertexPosition');\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, FSIZE * 4, 0);\n gl.enableVertexAttribArray(aPosition);\n let aTexCoord = gl.getAttribLocation(gl.program, 'aTextureCoord');\n gl.vertexAttribPointer(aTexCoord, 2, gl.FLOAT, false, FSIZE * 4, FSIZE * 2);\n\n let projectionMatrix = gl.getUniformLocation(gl.program, 'projectionMatrix');\n gl.uniformMatrix3fv(projectionMatrix, false, new Float32Array(\n [ 1, 0, 0,\n 0, 1, 0,\n 0, 0, 1 ]));\n gl.enableVertexAttribArray(aTexCoord);\n return {\n aPosition,\n aTexCoord,\n };\n}\n\nfunction initLocation(gl) {\n let uSampler = gl.getUniformLocation(gl.program, 'uSampler');\n let uOffset = gl.getUniformLocation(gl.program, 'uOffset');\n let uClamp = gl.getUniformLocation(gl.program, 'filterClamp');\n return {\n uSampler,\n uOffset,\n uClamp,\n };\n}\n\nfunction createAndSetupTexture(gl) {\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // 设置材质,这样我们可以对任意大小的图像进行像素操作\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n return texture;\n}\n\nclass KawaseBlurFilter {\n constructor(webgl, blur = 1, quality = 4) {\n this.webgl = webgl;\n let gl = this.gl = webgl.ctx;\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n initShaders(gl, VERTEX, FRAGMENT);\n this.vertexLocations = initVertexBuffers(gl);\n this.textureLocations = initLocation(gl);\n this._pixelSize = { x: 0, y: 0 };\n this.pixelSize = 1;\n this._kernels = null;\n this._blur = blur;\n this.quality = quality;\n // 创建两个纹理绑定到帧缓冲\n this.textures = [];\n this.framebuffers = [];\n }\n\n initBuffers(gl, width, height) {\n for (let i = 0; i < 2; i++) {\n let texture = createAndSetupTexture(gl);\n this.textures.push(texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n // 创建一个帧缓冲\n let fbo = gl.createFramebuffer();\n this.framebuffers.push(fbo);\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n // 绑定纹理到帧缓冲\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n }\n }\n\n draw(image, uOffsetArray, clear) {\n let { uOffset, uClamp } = this.textureLocations;\n let { gl } = this;\n gl.uniform2f(uOffset, uOffsetArray[0], uOffsetArray[1]);\n gl.viewport(0, 0, image.width, image.height);\n gl.uniform4f(uClamp, 0, 0, image.width, image.height);\n if (clear) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n apply(target, width, height) {\n let { gl } = this;\n this.initBuffers(gl, width, height);\n let { uSampler } = this.textureLocations;\n gl.uniform1i(uSampler, 0);\n let originalImageTexture = createAndSetupTexture(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, target.canvas);\n\n let uvX = this._pixelSize.x / width;\n let uvY = this._pixelSize.y / height;\n let offset;\n let last = this._quality - 1;\n // 从原始图像开始\n gl.bindTexture(gl.TEXTURE_2D, originalImageTexture);\n for (let i = 0; i < last; i++) {\n offset = this._kernels[i] + 0.5;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffers[i % 2]);\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, false);\n gl.bindTexture(gl.TEXTURE_2D, this.textures[i % 2]);\n }\n offset = this._kernels[last] + 0.5;\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, true);\n this.webgl.draw();\n target.ctx.clearRect(0, 0, width, height);\n target.ctx.drawImage(gl.canvas, 0, 0);\n target.draw();\n return this;\n }\n\n /**\n * Auto generate kernels by blur & quality\n * @private\n */\n _generateKernels() {\n let blur = this._blur;\n let quality = this._quality;\n let kernels = [ blur ];\n\n if (blur > 0) {\n let k = blur;\n let step = blur / quality;\n\n for (let i = 1; i < quality; i++) {\n k -= step;\n kernels.push(k);\n }\n }\n\n this._kernels = kernels;\n }\n\n /**\n * The kernel size of the blur filter, for advanced usage.\n *\n * @member {number[]}\n * @default [0]\n */\n get kernels() {\n return this._kernels;\n }\n\n set kernels(value) {\n if (Array.isArray(value) && value.length > 0) {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max.apply(Math, value);\n } else {\n // if value is invalid , set default value\n this._kernels = [ 0 ];\n this._quality = 1;\n }\n }\n\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n *\n * @member {PIXI.Point|number[]}\n * @default [1, 1]\n */\n set pixelSize(value) {\n if (typeof value === 'number') {\n this._pixelSize.x = value;\n this._pixelSize.y = value;\n } else if (Array.isArray(value)) {\n this._pixelSize.x = value[0];\n this._pixelSize.y = value[1];\n } else {\n // if value is invalid , set default value\n this._pixelSize.x = 1;\n this._pixelSize.y = 1;\n }\n }\n\n get pixelSize() {\n return this._pixelSize;\n }\n\n /**\n * The quality of the filter, integer greater than `1`.\n *\n * @member {number}\n * @default 3\n */\n get quality() {\n return this._quality;\n }\n\n set quality(value) {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n }\n\n /**\n * The amount of blur, value greater than `0`.\n *\n * @member {number}\n * @default 4\n */\n get blur() {\n return this._blur;\n }\n\n set blur(value) {\n this._blur = value;\n this._generateKernels();\n }\n\n clear() {\n let gl = this.gl;\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n}\n\nfunction gaussBlur(target, webgl, blur, width, height) {\n return new KawaseBlurFilter(webgl, blur).apply(target, width, height);\n}\n\nexport default {\n gaussBlur,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass LineBox {\n constructor(parent, x, y, w, content) {\n this.__parent = parent;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__content = content;\n this.__virtualDom = {};\n }\n\n render(renderMode, ctx, computedStyle, cacheStyle) {\n let { content, x, y, parent } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox;\n y += oy;\n if(renderMode === mode.CANVAS) {\n ctx.fillText(content, x, y);\n }\n else if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props: [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle.color],\n ['font-family', computedStyle.fontFamily],\n ['font-weight', computedStyle.fontWeight],\n ['font-style', computedStyle.fontStyle],\n ['font-size', computedStyle.fontSize + 'px']\n ],\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return css.getBaseLine(this.parent.computedStyle);\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n}\n\nexport default LineBox;\n","import Node from './Node';\nimport LineBox from './LineBox';\nimport mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__lineBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n static CHAR_WIDTH_CACHE = {};\n static MEASURE_TEXT = {\n list: [],\n data: {},\n };\n\n // 预先计算每个字的宽度\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n if(renderMode === mode.CANVAS) {\n ctx.font = css.setFontStyle(computedStyle);\n }\n let key = computedStyle.fontSize + ',' + computedStyle.fontFamily;\n let wait = Text.MEASURE_TEXT.data[key] = Text.MEASURE_TEXT.data[key] || {\n key,\n style: computedStyle,\n hash: {},\n s: [],\n };\n let cache = Text.CHAR_WIDTH_CACHE[key] = Text.CHAR_WIDTH_CACHE[key] || {};\n let sum = 0;\n let needMeasure = false;\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n Text.MEASURE_TEXT.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, computedStyle, charWidthList } = this;\n let key = computedStyle.fontSize + ',' + computedStyle.fontFamily;\n let cache = Text.CHAR_WIDTH_CACHE[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n __layout(data, isVirtual) {\n let { x, y, w } = data;\n this.__x = x;\n this.__y = y;\n let { isDestroyed, content, computedStyle, lineBoxes, charWidthList } = this;\n if(isDestroyed || computedStyle.display === 'none') {\n return;\n }\n this.__ox = this.__oy = 0;\n lineBoxes.splice(0);\n // 顺序尝试分割字符串为lineBox,形成多行\n let begin = 0;\n let i = 0;\n let count = 0;\n let length = content.length;\n let maxW = 0;\n while(i < length) {\n count += charWidthList[i];\n if(count === w) {\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, i + 1));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n begin = i + 1;\n i = begin;\n count = 0;\n }\n else if(count > w) {\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行\n if(i === begin) {\n i = begin + 1;\n width = count;\n }\n else {\n width = count - charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, width, content.slice(begin, i));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, width);\n y += computedStyle.lineHeight;\n begin = i;\n count = 0;\n }\n else {\n i++;\n }\n }\n // 最后一行,只有一行未满时也进这里\n if(begin < length && begin < i) {\n count = 0;\n for(i = begin; i < length; i++) {\n count += charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, length));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n }\n this.__width = maxW;\n this.__height = y - data.y;\n // flex/abs前置计算无需真正布局\n if(!isVirtual) {\n let { textAlign } = computedStyle;\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxes.forEach(lineBox => {\n let diff = this.__width - lineBox.width;\n if(diff > 0) {\n lineBox.__offsetX(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n }\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n }\n\n __tryLayInline(w) {\n return w - this.textWidth;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\n }\n\n render(renderMode, ctx) {\n if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n let { isDestroyed, computedStyle, lineBoxes, cacheStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') {\n return;\n }\n if(renderMode === mode.CANVAS) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle.color;\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n }\n lineBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = lineBoxes.map(lineBox => lineBox.virtualDom);\n }\n }\n\n deepScan(cb) {\n cb(this);\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get lineBoxes() {\n return this.__lineBoxes;\n }\n\n get charWidthList() {\n return this.__charWidthList;\n }\n\n get charWidth() {\n return this.__charWidth;\n }\n\n get textWidth() {\n return this.__textWidth;\n }\n\n get baseLine() {\n let { lineBoxes } = this;\n if(!lineBoxes.length) {\n return 0;\n }\n let last = lineBoxes[lineBoxes.length - 1];\n return last.y - this.y + last.baseLine;\n }\n\n get currentStyle() {\n return this.parent.currentStyle;\n }\n\n get computedStyle() {\n return this.parent.computedStyle;\n }\n\n get cacheStyle() {\n return this.parent.__cacheStyle;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import Text from '../node/Text';\rimport util from './util';\r\rconst SPF = 1000 / 60;\r\rconst CANVAS = {};\rconst WEBGL = {};\r\rfunction cacheCanvas(key, width, height) {\r let o;\r if(!CANVAS[key]) {\r o = CANVAS[key] = document.createElement('canvas');\r }\r else {\r o = CANVAS[key];\r }\r o.setAttribute('width', width);\r o.setAttribute('height', height);\r o.style.width = width + 'px';\r o.style.height = height + 'px';\r return {\r canvas: o,\r ctx: o.getContext('2d'),\r draw() {\r // 空函数,仅对小程序提供hook特殊处理,flush缓冲\r },\r };\r}\r\rfunction cacheWebgl(key, width, height) {\r let o;\r if(!WEBGL[key]) {\r o = WEBGL[key] = document.createElement('canvas');\r }\r else {\r o = WEBGL[key];\r }\r o.setAttribute('width', width);\r o.setAttribute('height', height);\r o.style.width = width + 'px';\r o.style.height = height + 'px';\r return {\r canvas: o,\r ctx: o.getContext('webgl') || o.getContext('experimental-webgl'),\r draw() {\r // 空函数,仅对小程序提供hook特殊处理,flush缓冲\r },\r };\r}\r\rconst IMG = {};\rconst INIT = 0;\rconst LOADING = 1;\rconst LOADED = 2;\r\rlet inject = {\r measureText(cb) {\r let { list, data } = Text.MEASURE_TEXT;\r let html = '';\r let keys = [];\r let chars = [];\r Object.keys(data).forEach(i => {\r let { key, style, s } = data[i];\r if(s) {\r let inline = `position:absolute;font-family:${style.fontFamily};font-size:${style.fontSize}px;font-weight:${style.fontWeight}`;\r for(let j = 0, len = s.length; j < len; j++) {\r keys.push(key);\r let char = s.charAt(j);\r chars.push(char);\r html += `${char.replace(/`;\r }\r }\r });\r if(!html) {\r cb();\r return;\r }\r let div = document.createElement('div');\r div.style.position = 'absolute';\r div.style.left = '99999px';\r div.style.top = '-99999px';\r div.style.visibility = 'hidden';\r document.body.appendChild(div);\r div.innerHTML = html;\r let cns = div.childNodes;\r let { CHAR_WIDTH_CACHE, MEASURE_TEXT } = Text;\r for(let i = 0, len = cns.length; i < len; i++) {\r let node = cns[i];\r let key = keys[i];\r let char = chars[i];\r // clientWidth只返回ceil整数,精度必须用getComputedStyle\r let css = window.getComputedStyle(node, null);\r CHAR_WIDTH_CACHE[key][char] = parseFloat(css.width);\r }\r list.forEach(text => text.__measureCb());\r cb();\r MEASURE_TEXT.list = [];\r MEASURE_TEXT.data = {};\r document.body.removeChild(div);\r },\r IMG,\r INIT,\r LOADED,\r LOADING,\r measureImg(url, cb) {\r let cache = IMG[url] = IMG[url] || {\r state: INIT,\r task: [],\r };\r if(cache.state === LOADED) {\r cb(cache);\r }\r else if(cache.state === LOADING) {\r cache.task.push(cb);\r }\r else {\r cache.state = LOADING;\r cache.task.push(cb);\r let img = new Image();\r img.onload = function() {\r cache.state = LOADED;\r cache.success = true;\r cache.width = img.width;\r cache.height = img.height;\r cache.source = img;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r img.onerror = function() {\r cache.state = LOADED;\r cache.success = false;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r if(url.substr(0, 5) !== 'data:') {\r let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\r if(host) {\r if(location.hostname !== host[1]) {\r img.crossOrigin = 'anonymous';\r }\r }\r }\r img.src = url;\r }\r },\r warn(s) {\r console.warn(s);\r },\r requestAnimationFrame(cb) {\r let res;\r if(typeof requestAnimationFrame !== 'undefined') {\r inject.requestAnimationFrame = requestAnimationFrame.bind(window);\r res = requestAnimationFrame(cb);\r }\r else {\r res = setTimeout(cb, SPF);\r inject.requestAnimationFrame = function(cb) {\r return setTimeout(cb, SPF);\r };\r }\r return res;\r },\r cancelAnimationFrame(id) {\r let res;\r if(typeof cancelAnimationFrame !== 'undefined') {\r inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\r res = cancelAnimationFrame(id);\r }\r else {\r res = clearTimeout(id);\r inject.cancelAnimationFrame = function(id) {\r return clearTimeout(id);\r };\r }\r return res;\r },\r now() {\r if(typeof performance !== 'undefined') {\r inject.now = performance.now.bind(performance);\r return Math.floor(performance.now());\r }\r inject.now = Date.now.bind(Date);\r return Date.now();\r },\r getCacheCanvas(width, height, key = '__$$cache$$__') {\r return cacheCanvas(key, width, height);\r },\r getCacheWebgl(width, height, key = '__$$cache$$__') {\r return cacheWebgl(key, width, height);\r },\r isDom(o) {\r if(o) {\r if(util.isString(o)) {\r return true;\r }\r if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\r return true;\r }\r if(util.isFunction(o.getElementsByTagName)) {\r return true;\r }\r }\r return false;\r },\r};\r\rexport default inject;\r","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n on(id, handle) {\n if(!handle) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else if(handle) {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction, isObject } = util;\n\nfunction traversal(list, diff, step) {\n if(step === 'before') {\n list.forEach(item => {\n if(isObject(item) && isFunction(item.before)) {\n item.before(diff);\n }\n });\n }\n else if(step === 'after') {\n list.forEach(item => {\n if(isObject(item) && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || !task.length) {\n return;\n }\n let now = self.__now = inject.now();\n let diff = now - last;\n diff = Math.max(diff, 0);\n // let delta = diff * 0.06; // 比例是除以1/60s,等同于*0.06\n last = now;\n // 优先动画计算\n let clone = task.slice(0);\n traversal(clone, diff, 'before');\n // 执行动画造成的刷新并清空,在root的refreshTask回调中可能被清空,因为task已经刷新过了\n self.__hookTask.splice(0).forEach(item => item());\n // 普通的before/after\n traversal(clone, diff, 'after');\n // 还有则继续,没有则停止节省性能\n if(task.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n if(!task.length) {\n this.__init();\n }\n task.push(handle);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n let item = task[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === handle || item.__karasFramecb === handle) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? diff => {\n handle(diff);\n this.offFrame(cb);\n } : {\n before: handle.before,\n after: diff => {\n handle.after && handle.after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n};\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\n\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER } = unit;\nconst { isNil, isFunction, isNumber, isObject, clone, equalArr } = util;\nconst { linear } = easing;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item.style;\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 空的过滤掉\n if(!isNil(v) && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(change.GEOM.hasOwnProperty(k)) {\n style[k] = target.currentProps[k];\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === 'transform') {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [['matrix', m]];\n }\n else if(v.unit === INHERIT) {\n if(k === 'color') {\n style[k] = {\n value: util.rgba2int(computedStyle[k]),\n unit: RGBA,\n };\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = {\n value: computedStyle[k],\n unit: PX,\n };\n }\n else if(k === 'fontWeight') {\n style[k] = {\n value: computedStyle[k],\n unit: NUMBER,\n };\n }\n else if(k === 'fontStyle' || k === 'fontFamily' || k === 'textAlign') {\n style[k] = {\n value: computedStyle[k],\n unit: STRING,\n };\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param frameStyle\n * @param animation\n * @param root\n */\nfunction genBeforeRefresh(frameStyle, animation, root) {\n root.__addUpdate({\n node: animation.target,\n style: frameStyle,\n });\n animation.__style = frameStyle;\n animation.__assigning = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\nfunction gen(frameStyle, animation, root) {\n root.__addUpdate({\n node: animation.target,\n style: frameStyle,\n });\n animation.__style = frameStyle;\n animation.__assigning = true;\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n style = css.normalize(style);\n return {\n style,\n time: offset * duration,\n easing: easing || es,\n transition: [],\n };\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target) {\n let res = {\n k,\n };\n let p = prev[k];\n let n = next[k];\n if(k === 'transform') {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = [1, 0, 0, 1, 0, 0];\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = [1, 0, 0, 1, 0, 0];\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res.v = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n ];\n return res;\n }\n else if(k === 'filter') {\n // 目前只有1个blur,可以简单处理\n if(!p || !p.length) {\n res.v = n[0][1];\n }\n else if(!n || !n.length) {\n res.v = -p[0][1];\n }\n else {\n res.v = n[0][1] - p[0][1];\n }\n }\n else if(k === 'transformOrigin') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY') {\n if(p.unit === n.unit && [PX, PERCENT].indexOf(p.unit) > -1) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'boxShadow') {\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res.v.push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p.unit === n.unit) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'backgroundSize') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit && [PX, PERCENT].indexOf(pi.unit) > -1) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else {\n return;\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n if(p.k !== n.k) {\n return;\n }\n // 渐变\n else if(p.k === 'linear' || p.k === 'radial') {\n let pv = p.v;\n let nv = n.v;\n if(equalArr(pv, nv)) {\n return;\n }\n res.v = [];\n let { innerWidth } = target;\n let eq;\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n eq = equalArr(t, [0, 0, 0, 0]);\n if(a[1] && b[1]) {\n if(a[1].unit === b[1].unit) {\n t.push(b[1].value - a[1].value);\n }\n else if(a[1].unit === PX && b[1].unit === PERCENT) {\n t.push(b[1].value * innerWidth * 0.01 - a[1].value);\n }\n else if(a[1].unit === PERCENT && b[1].unit === PX) {\n t.push(b[1].value * 100 / innerWidth - a[1].value);\n }\n if(eq) {\n eq = t[4] === 0;\n }\n }\n else if(a[1] || b[1]) {\n eq = false;\n }\n res.v.push(t);\n }\n // 线性渐变有角度差值变化\n if(p.k === 'linear') {\n let v = n.d - p.d;\n if(eq && v === 0) {\n return;\n }\n res.d = v;\n }\n // 径向渐变的位置\n else {\n res.p = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp.unit === np.unit) {\n res.p.push(np.value - pp.value);\n }\n else if(pp.unit === PX && np.unit === PERCENT) {\n let v = np.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n else if(pp.unit === PERCENT && np.unit === PX) {\n let v = np.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n }\n if(eq && equalArr(res.p, [0, 0])) {\n return;\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, p)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n.value;\n p = p.value;\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0].value === p[0].value && n[0].unit === p[0].unit\n && n[1].value === p[1].value && n[1].unit === p[1].unit) {\n return;\n }\n res.v = [];\n for(let i = 0; i < 2; i++) {\n if(n[i].unit === p[i].unit) {\n res.v.push(n[i].value - p[i].value);\n }\n else if(p[i].unit === PX && n[i].unit === PERCENT) {\n res.v.push(n[i].value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else if(p[i].unit === PERCENT && n[i].unit === PX) {\n res.v.push(n[i].value * 100 / target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else {\n res.v.push(0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p.unit === AUTO || n.unit === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.parent || target).computedStyle;\n let diff = 0;\n if(p.unit === n.unit) {\n diff = n.value - p.value;\n }\n // 长度单位变化特殊计算,根据父元素computedStyle\n else if(p.unit === PX && n.unit === PERCENT) {\n let v;\n if(k === 'fontSize') {\n v = n.value * parentComputedStyle[k] * 0.01;\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.width * 0.01;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.height * 0.01;\n }\n diff = v - p.value;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v;\n if(k === 'fontSize') {\n v = n.value * 100 / parentComputedStyle[k];\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.width;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.height;\n }\n diff = v - p.value;\n }\n // lineHeight奇怪的单位变化\n else if(k === 'lineHeight') {\n if(p.unit === PX && n.unit === NUMBER) {\n diff = n.value * computedStyle.fontSize - p.value;\n }\n else if(p.unit === NUMBER && n.unit === PX) {\n diff = n.value / computedStyle.fontSize - p.value;\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res.v = diff;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n res.v.push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res.v = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\n return;\n }\n else {\n res.v = n - p;\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n if(n === p) {\n return;\n }\n res.v = n - p;\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target) {\n keys.forEach(k => {\n let ts = calDiff(prev.style, next.style, k, target);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev.transition.push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame.time > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame.time === time) {\n return middle;\n }\n else if(frame.time > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(/^\\s*(?:cubic-bezier\\s*)?\\(\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*,\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*\\)\\s*$/i.test(ea)) {\n let v = ea.match(/[\\d.]+/g);\n timingFunction = easing.cubicBezier(v[0], v[1], v[2], v[3]);\n }\n else if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing[ea] || linear;\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, percent, target) {\n let style = clone(frame.style);\n let timingFunction = getEasing(frame.easing);\n if(timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n frame.transition.forEach(item => {\n let { k, v, d, p } = item;\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === 'transform') {\n if(!st) {\n st = style[k] = [['matrix', [1, 0, 0, 1, 0, 0]]];\n }\n for(let i = 0; i < 6; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n else if(k === 'filter') {\n // 只有1个样式声明了filter另外一个为空\n if(!st) {\n st = style[k] = [['blur', 0]];\n }\n st[0][1] += v * percent;\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i].value += v[i] * percent;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n if(v !== 0) {\n st.value += v * percent;\n }\n }\n else if(k === 'transformOrigin' || k === 'backgroundSize') {\n if(v[0] !== 0) {\n st[0].value += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1].value += v[1] * percent;\n }\n }\n else if(k === 'boxShadow') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n if(GRADIENT_TYPE.hasOwnProperty(st.k)) {\n for(let i = 0, len = Math.min(st.v.length, v.length); i < len; i++) {\n let a = st.v[i];\n let b = v[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1].value += b[1] * percent;\n }\n }\n if(st.k === 'linear' && st.d !== undefined && d !== undefined) {\n st.d += d * percent;\n }\n if(st.k === 'radial' && st.p !== undefined && p !== undefined) {\n st.p[0].value += p[0] * percent;\n st.p[1].value += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st.value;\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n let st = style[k];\n if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n style[k] += v * percent;\n }\n });\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n this.__target = target;\n list = clone(list || []);\n if(Array.isArray(list)) {\n this.__list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n this.__list = nl;\n }\n else {\n this.__list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {};\n this.__duration = Math.max(0, parseFloat(op.duration) || 0);\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.iterations = op.iterations;\n this.fps = op.fps;\n this.fill = op.fill;\n this.direction = op.direction;\n this.playbackRate = op.playbackRate;\n this.__easing = op.easing;\n this.playCount = 0;\n this.spfLimit = op.spfLimit; // 定帧功能,不跳帧,每帧时间限制为最大spf\n this.__frames = []; // 每帧数据\n this.__framesR = []; // 存储反向播放的数据\n this.__startTime = null;\n this.currentTime = 0; // 当前播放时间点,不包括暂停时长,但包括delay、变速,以此定位动画处于何时\n this.__nextTime = 0; // 下一帧刷新时间点,即currentTime下一帧被此赋值\n this.__fpsTime = 0;\n this.__playState = 'idle';\n this.__isDestroyed = false;\n this.__style = {};\n this.__assigning = false; // 本帧动画是否正在影响赋值style,即在事件的before之后after之前\n this.__init();\n }\n\n __init() {\n let { iterations, duration, list, easing, target } = this;\n // 执行次数小于1无需播放\n if(iterations < 1 || list.length < 1) {\n return;\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n this.__frames = frames;\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的默认样式\n let keys = this.__keys = unify(frames, target);\n inherit(frames, keys, target);\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let o = this.__originStyle = {};\n keys.forEach(k => {\n if(change.isGeom(tagName, k)) {\n o[k] = props[k];\n }\n o[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target);\n }\n // 反向存储帧的倒排结果\n let framesR = clone(frames).reverse();\n framesR.forEach(item => {\n item.time = duration - item.time;\n item.transition = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target);\n }\n this.__framesR = framesR;\n // finish/cancel共有的before处理\n this.__clean = (isFinish) => {\n this.__cancelTask();\n this.__nextTime = 0;\n let restore;\n let style = this.style;\n if(isFinish) {\n this.__currentTime = this.delay + duration + this.endDelay;\n this.__playCount = iterations;\n this.__playState = 'finished';\n // cancel需要清除finish根据情况保留\n if(!this.__stayEnd()) {\n this.__style = {};\n restore = true;\n }\n }\n else {\n this.__playCount = this.__currentTime = 0;\n this.__playState = 'idle';\n this.__style = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(change.GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n target.__cancelCacheSvg();\n });\n }\n };\n // 生成finish的任务事件\n this.__fin = (cb, diff) => {\n this.__begin = this.__end = this.__isDelay = this.__finish = this.__inFps = this.__enterFrame = null;\n this.emit(Event.FINISH);\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n };\n // 同步执行,用在finish()这种主动调用\n this.__frameCb = (diff, isDelay) => {\n this.emit(Event.FRAME, diff, isDelay);\n if(this.__firstPlay) {\n this.__firstPlay = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(this.__playCb)) {\n this.__playCb(diff, isDelay);\n this.__playCb = null;\n }\n };\n }\n\n __calDiffTime(diff) {\n let { playbackRate, spfLimit, fps } = this;\n this.__currentTime = this.__nextTime;\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n this.__nextTime += diff;\n return this.__currentTime;\n }\n\n play(cb) {\n let { isDestroyed, duration, playState, __frameCb, list } = this;\n if(isDestroyed || duration <= 0 || list.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n this.__playCb = cb;\n this.__playState = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n this.__firstPlay = true;\n let firstEnter = true;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!this.__enterFrame) {\n let {\n frames,\n framesR,\n direction,\n delay,\n endDelay,\n __clean,\n __fin,\n target,\n } = this;\n // delay/endDelay/fill/direction在播放后就不可变更,没播放可以修改\n let stayEnd = this.__stayEnd();\n let stayBegin = this.__stayBegin();\n // 每次正常调用play都会从头开始,标识第一次enterFrame运行初始化\n this.__currentTime = this.__nextTime = this.__fpsTime = 0;\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n // 每帧执行的回调,firstEnter只有初次计算时有,第一帧强制不跳帧\n let enterFrame = this.__enterFrame = {\n before: diff => {\n let { root, fps, playCount, iterations } = this;\n if(!root) {\n return;\n }\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let currentTime = this.__calDiffTime(diff);\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!firstEnter && fps < 60) {\n diff = this.__fpsTime += diff;\n if(diff < 1000 / fps) {\n this.__inFps = true;\n return;\n }\n this.__fpsTime = 0;\n }\n firstEnter = false;\n // delay仅第一次生效\n if(playCount > 0) {\n delay = 0;\n }\n // 还没过前置delay\n if(currentTime < delay) {\n if(stayBegin) {\n let current = frames[0].style;\n genBeforeRefresh(current, this, root);\n }\n // 即便不刷新,依旧执行begin和帧回调\n if(currentTime === 0) {\n this.__begin = true;\n }\n this.__isDelay = true;\n return;\n }\n // 根据播放次数确定正反方向\n let currentFrames;\n if(direction === 'reverse') {\n currentFrames = framesR;\n }\n else if({ alternate: true, 'alternate-reverse': true }.hasOwnProperty(direction)) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = isEven ? frames : framesR;\n }\n else {\n currentFrames = isEven ? framesR : frames;\n }\n }\n else {\n currentFrames = frames;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0) {\n this.__begin = true;\n }\n let i = binarySearch(0, length - 1, currentTime, currentFrames);\n let current = currentFrames[i];\n // 最后一帧结束动画\n let isLastFrame = i === length - 1;\n let isLastCount = playCount >= iterations - 1;\n let inEndDelay;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n if(isLastFrame) {\n // endDelay实际最后一次播放时生效,这里仅计算时间对比\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n // 多次播放时到达最后一帧也会显示\n if(stayEnd || !isLastCount) {\n current = current.style;\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = this.__originStyle;\n }\n // 非尾每轮次放完增加次数和计算下轮准备\n if(!isLastCount) {\n this.__nextTime = currentTime - duration;\n playCount = ++this.__playCount;\n this.__nextBegin = true;\n }\n // 尾次考虑endDelay\n else if(!inEndDelay) {\n this.__nextTime = 0;\n playCount = ++this.__playCount;\n // 判断次数结束每帧enterFrame调用,inEndDelay时不结束\n if(playCount >= iterations) {\n frame.offFrame(enterFrame);\n }\n }\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else {\n let total = currentFrames[i + 1].time - current.time;\n let percent = (currentTime - current.time) / total;\n current = calIntermediateStyle(current, percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, this, root);\n // 每次循环完触发end事件,最后一次循环触发finish\n if(isLastFrame && (!inEndDelay || isLastCount)) {\n this.__end = true;\n if(playCount >= iterations) {\n this.__finish = true;\n __clean(true);\n }\n }\n },\n after: diff => {\n this.__assigning = false;\n if(this.__inFps) {\n this.__inFps = false;\n return;\n }\n __frameCb(diff, this.__isDelay);\n this.__isDelay = false;\n if(this.__begin) {\n this.__begin = false;\n this.emit(Event.BEGIN, this.playCount);\n }\n if(this.__end) {\n this.__end = false;\n this.emit(Event.END, this.playCount - 1);\n }\n if(this.__finish) {\n this.__finish = false;\n __fin();\n }\n if(this.__nextBegin) {\n this.__nextBegin = false;\n this.__begin = true;\n }\n },\n };\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this.__enterFrame);\n frame.onFrame(this.__enterFrame);\n this.__startTime = frame.__now;\n return this;\n }\n\n pause() {\n let { isDestroyed, duration, pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n this.__playState = 'paused';\n this.__cancelTask();\n this.emit(Event.PAUSE);\n return this;\n }\n\n resume(cb) {\n let { isDestroyed, duration, playState } = this;\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || list.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let { root, frames, __frameCb, __clean, __fin, __originStyle } = self;\n if(root) {\n let current;\n // 停留在最后一帧\n if(self.__stayEnd()) {\n current = frames[frames.length - 1].style;\n }\n else {\n current = __originStyle;\n }\n root.addRefreshTask({\n before() {\n genBeforeRefresh(current, self, root);\n __clean(true);\n },\n after(diff) {\n self.__assigning = false;\n __frameCb(diff);\n __fin(cb, diff);\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || playState === 'idle' || list.length < 1) {\n return self;\n }\n self.__cancelTask();\n let { root, __frameCb, __clean, __originStyle } = self;\n if(root) {\n let task = (diff) => {\n self.__cancelTask();\n self.__begin = self.__end = self.__isDelay = self.__finish = self.__inFps = self.__enterFrame = null;\n self.emit(Event.CANCEL);\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n };\n root.addRefreshTask({\n before() {\n genBeforeRefresh(__originStyle, self, root);\n __clean();\n },\n after(diff) {\n self.__assigning = false;\n __frameCb(diff);\n task(diff);\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n this.__playState = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb(diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let { style, target, keys } = this;\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(change.GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let { duration, iterations, delay } = this;\n this.__playState = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += delay;\n }\n // 超过时间长度需要累加次数\n while(v > duration && this.playCount < iterations - 1) {\n this.__playCount++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n this.__nextTime = v;\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __cancelTask() {\n frame.offFrame(this.__enterFrame);\n this.__playCb = null;\n }\n\n __destroy(sync) {\n let self = this;\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean && self.__clean();\n self.__target = null;\n }\n else {\n frame.nextFrame({\n before() {\n // 尚未初始化的清除\n self.__clean && self.__clean();\n self.__target = null;\n },\n });\n }\n self.__startTime = null;\n self.__isDestroyed = true;\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__target;\n }\n\n get root() {\n return this.target.root;\n }\n\n get keys() {\n return this.__keys;\n }\n\n get style() {\n return this.__style;\n }\n\n get list() {\n return this.__list;\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__duration;\n }\n\n set duration(v) {\n this.__duration = Math.max(0, parseFloat(v) || 0);\n }\n\n get delay() {\n return this.__delay;\n }\n\n set delay(v) {\n this.__delay = Math.max(0, parseFloat(v) || 0);\n }\n\n get endDelay() {\n return this.__endDelay;\n }\n\n set endDelay(v) {\n this.__endDelay = Math.max(0, parseFloat(v) || 0);\n }\n\n get fps() {\n return this.__fps;\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n if(v <= 0) {\n v = 60;\n }\n this.__fps = v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__iterations;\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n this.__iterations = v;\n }\n\n get fill() {\n return this.__fill;\n }\n\n set fill(v) {\n this.__fill = v || 'none';\n }\n\n get direction() {\n return this.__direction;\n }\n\n set direction(v) {\n this.__direction = v || 'normal';\n }\n\n get frames() {\n return this.__frames;\n }\n\n get framesR() {\n return this.__framesR;\n }\n\n get playbackRate() {\n return this.__playbackRate;\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n this.__playbackRate = v;\n }\n\n get easing() {\n return this.__easing;\n }\n\n get startTime() {\n return this.__startTime;\n }\n\n get currentTime() {\n return this.__currentTime;\n }\n\n set currentTime(v) {\n v = parseFloat(v) || 0;\n if(v >= 0) {\n this.__currentTime = this.__nextTime = v;\n }\n }\n\n get pending() {\n return this.playState !== 'running';\n }\n\n get finished() {\n return this.playState === 'finished';\n }\n\n get playState() {\n return this.__playState;\n }\n\n get playCount() {\n return this.__playCount;\n }\n\n set playCount(v) {\n this.__playCount = Math.max(0, parseInt(v) || 0);\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n get animating() {\n let { playState } = this;\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || this.__stayEnd();\n }\n\n get spfLimit() {\n return this.__spfLimit;\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n this.__spfLimit = Math.max(v, parseInt(v) || 0);\n }\n else {\n this.__spfLimit = !!v;\n }\n }\n\n get assigning() {\n return this.__assigning;\n }\n}\n\nexport default Animation;\n","import change from './change';\n\nconst ENUM = {\n // 低4位表示repaint级别\n NONE: 0, // 完全没有变化\n TRANSFORM: 1, // 仅matrix变化 1\n OPACITY: 2, // 仅透明度变化 10\n FILTER: 4, // 仅滤镜变化 100\n TRANSFORM_OPACITY: 3, // 11\n TRANSFORM_FILTER: 5, // 101\n OPACITY_FILTER: 6, // 110\n TRANSFORM_OPACITY_FILTER: 7, // 111\n REPAINT: 8, // 整体需要重绘 1000\n\n // 高位表示reflow\n REFLOW: 16, // 整体需要重排 1000000\n};\n\nconst TRANSFORM = {\n translateX: true,\n translateY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n};\n\nlet o = Object.assign({\n /**\n * 仅得出大概等级none/repaint/reflow\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n /**\n * 根据大概等级细化repaint分级\n * @param style\n * @param lv\n */\n getDetailLevel(style, lv) {\n if(o.eq(lv, ENUM.NONE)) {\n return ENUM.NONE;\n }\n if(o.eq(lv, ENUM.REPAINT)) {\n let lv = ENUM.NONE;\n for(let i in style) {\n if(style.hasOwnProperty(i)) {\n if(TRANSFORM.hasOwnProperty(i)) {\n lv |= ENUM.TRANSFORM;\n }\n else if(i === 'opacity') {\n lv |= ENUM.OPACITY;\n }\n else if(i === 'filter') {\n lv |= ENUM.FILTER;\n }\n else {\n lv |= ENUM.REPAINT;\n }\n }\n }\n return lv;\n }\n else {\n return ENUM.REFLOW;\n }\n },\n eq(lv, value) {\n return (lv & value) === value;\n },\n gt(lv, value) {\n return (lv & value) > value;\n },\n gte(lv, value) {\n return (lv & value) >= value;\n },\n lt(lv, value) {\n return (lv & value) < value;\n },\n lte(lv, value) {\n return (lv & value) <= value;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n}, ENUM);\n\nexport default o;\n","import Node from './Node';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport gradient from '../style/gradient';\nimport border from '../style/border';\nimport css from '../style/css';\nimport image from '../style/image';\nimport blur from '../style/blur';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport Animation from '../animate/Animation';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\n\nconst { AUTO, PX, PERCENT, STRING, INHERIT } = unit;\nconst { clone, int2rgba, equalArr, extend, joinArr } = util;\nconst { calRelative } = css;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBorder(renderMode, points, color, ctx, xom) {\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nfunction renderBgc(renderMode, color, x, y, w, h, ctx, xom, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr, method = 'fill') {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr);\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, w, h);\n }\n ctx[method]();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(list) {\n let d = svgPolygon(list);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color]\n ],\n });\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'rect',\n props: [\n ['x', x],\n ['y', y],\n ['width', w],\n ['height', h],\n ['fill', color]\n ],\n });\n }\n }\n}\n\nlet borderRadiusKs = ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'];\nfunction calBorderRadius(w, h, currentStyle, computedStyle) {\n let noRadius = true;\n borderRadiusKs.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item.value > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item.unit === PX) {\n return Math.max(0, item.value);\n }\n else {\n return Math.max(0, item.value * (i ? h : w) * 0.01);\n }\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n borderRadiusKs.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[borderRadiusKs[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBackgroundSize(value, w, h) {\n let res = [];\n value.forEach((item, i) => {\n if(item.unit === PX) {\n res.push(item.value);\n }\n else if(item.unit === PERCENT) {\n res.push(item.value * (i ? h : w) * 0.01);\n }\n else if(item.unit === AUTO) {\n res.push(-1);\n }\n else if(item.unit === STRING) {\n res.push(item.value === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size) {\n if(position.unit === PX) {\n return position.value;\n }\n else if(position.unit === PERCENT) {\n return (container - size) * position.value * 0.01;\n }\n return 0;\n}\n\nfunction renderBoxShadow(renderMode, ctx, defs, data, xom, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight) {\n let [x, y, blur, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(blur) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1, y4],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (blur > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = mx.int2convolution(blur);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nfunction empty() {}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n this.__refreshLevel = level.REFLOW;\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n }\n\n // 获取margin/padding的实际值\n __mp(currentStyle, computedStyle, w) {\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left',\n ].forEach(k => {\n let a = 'margin' + k;\n let b = 'padding' + k;\n computedStyle[a] = this.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(mp, w) {\n if(mp.unit === PX) {\n return mp.value;\n }\n else if(mp.unit === PERCENT) {\n return mp.value * w * 0.01;\n }\n return 0;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,比如flex列计算时\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, !this.parent);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle } = this;\n let {\n display,\n width,\n position,\n } = currentStyle;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height = computedStyle.width = computedStyle.height = 0;\n return;\n }\n this.__layoutData = clone(data);\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n if(width.unit !== AUTO) {\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n this.__ox = this.__oy = 0;\n // 3种布局,默认block\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inline') {\n this.__layoutInline(data, isVirtual);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { top, right, bottom, left } = currentStyle;\n let { parent } = this;\n if(top.unit !== AUTO) {\n let n = calRelative(currentStyle, 'top', top, parent);\n this.__offsetY(n);\n computedStyle.top = n;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n let n = calRelative(currentStyle, 'bottom', bottom, parent);\n this.__offsetY(-n);\n computedStyle.bottom = n;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n if(left.unit !== AUTO) {\n let n = calRelative(currentStyle, 'left', left, parent, true);\n this.__offsetX(n);\n computedStyle.left = n;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n let n = calRelative(currentStyle, 'right', right, parent, true);\n this.__offsetX(-n);\n computedStyle.right = n;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n }\n else if(currentStyle.position !== 'absolute') {\n computedStyle.top = computedStyle.bottom = computedStyle.left = computedStyle.right = 'auto';\n }\n // 计算结果存入computedStyle\n computedStyle.width = this.width;\n computedStyle.height = this.height;\n // 设置缓存hash,render时计算\n this.__cacheStyle = {};\n this.__cacheSvg = false;\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records = ac.__records.concat(ar.list);\n }\n // 自动播放进入列表开始播放\n else {\n ac.__auto = ac.__auto.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data) {\n let { x, y, w, h, w2, h2 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n else if(width.unit !== AUTO) {\n fixedWidth = true;\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(height.unit !== AUTO) {\n fixedHeight = true;\n switch(height.unit) {\n case PX:\n h = height.value;\n break;\n case PERCENT:\n h *= height.value * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n y += borderTopWidth + marginTop + paddingTop;\n data.y = y;\n if(width.unit === AUTO) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height.unit === AUTO) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n position,\n marginLeft,\n marginRight,\n width,\n } = style;\n if(position !== 'absolute' && width !== AUTO && marginLeft.unit === AUTO && marginRight.unit === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param ctx\n * @param defs\n */\n render(renderMode, ctx, defs) {\n if(renderMode === mode.SVG) {\n if(this.__cacheSvg) {\n let n = extend({}, this.__virtualDom);\n n.cache = true;\n this.__virtualDom = n;\n return;\n }\n this.__cacheSvg = true;\n this.__virtualDom = {\n bb: [],\n children: [],\n opacity: 1,\n };\n }\n let {\n isDestroyed,\n currentStyle,\n computedStyle,\n width,\n height,\n innerWidth,\n innerHeight,\n outerWidth,\n outerHeight,\n __cacheStyle,\n parent,\n } = this;\n if(isDestroyed || computedStyle.display === 'none') {\n return;\n }\n // 使用sx和sy渲染位置,考虑了relative和translate影响\n let { sx: x, sy: y } = this;\n let {\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth,\n borderBottomWidth,\n } = computedStyle;\n let x1 = x + marginLeft;\n let x2 = x1 + borderLeftWidth;\n let x3 = x2 + width + paddingLeft + paddingRight;\n let x4 = x3 + borderRightWidth;\n let y1 = y + marginTop;\n let y2 = y1 + borderTopWidth;\n let y3 = y2 + height + paddingTop + paddingBottom;\n let y4 = y3 + borderBottomWidth;\n let {\n backgroundPositionX,\n backgroundPositionY,\n } = currentStyle;\n let matrixCache = __cacheStyle.matrix;\n // 先根据cache计算需要重新计算的computedStyle\n if(__cacheStyle.transformOrigin === undefined) {\n __cacheStyle.transformOrigin = true;\n matrixCache = false;\n computedStyle.transformOrigin = tf.calOrigin(currentStyle.transformOrigin, outerWidth, outerHeight);\n }\n if(__cacheStyle.transform === undefined\n || __cacheStyle.translateX === undefined\n || __cacheStyle.translateY === undefined\n || __cacheStyle.rotateZ === undefined\n || __cacheStyle.scaleX === undefined\n || __cacheStyle.scaleY === undefined\n || __cacheStyle.skewX === undefined\n || __cacheStyle.skewY === undefined) {\n __cacheStyle.transform\n = __cacheStyle.translateX\n = __cacheStyle.translateY\n = __cacheStyle.rotateZ\n = __cacheStyle.scaleX\n = __cacheStyle.scaleY\n = __cacheStyle.skewX\n = __cacheStyle.skewY\n = true;\n matrixCache = false;\n let matrix;\n // transform相对于自身\n if(currentStyle.transform) {\n matrix = tf.calMatrix(currentStyle.transform, outerWidth, outerHeight);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n 'translateX',\n 'translateY',\n 'rotateZ',\n 'rotate',\n 'skewX',\n 'skewY',\n 'scaleX',\n 'scaleY',\n ].forEach(k => {\n let v = currentStyle[k];\n if(util.isNil(v)) {\n return;\n }\n computedStyle[k] = v.value;\n // scale为1和其它为0避免计算浪费\n let isScale = k.indexOf('scale') > -1;\n if(v.value === 1 && isScale || !isScale && v.value === 0) {\n return;\n }\n if(v.unit === PERCENT) {\n if(k === 'translateX') {\n computedStyle[k] = v.value * outerWidth * 0.01;\n }\n else if(k === 'translateY') {\n computedStyle[k] = v.value * outerHeight * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, outerWidth, outerHeight);\n }\n }\n this.__matrix = computedStyle.transform = matrix || [1, 0, 0, 1, 0, 0];\n }\n if(__cacheStyle.backgroundPositionX === undefined) {\n __cacheStyle.backgroundPositionX = true;\n computedStyle.backgroundPositionX = backgroundPositionX.unit === PX\n ? backgroundPositionX.value : backgroundPositionX.value * innerWidth;\n }\n if(__cacheStyle.backgroundPositionY === undefined) {\n __cacheStyle.backgroundPositionY = true;\n computedStyle.backgroundPositionY = backgroundPositionY.unit === PX\n ? backgroundPositionY.value : backgroundPositionY.value * innerWidth;\n }\n if(__cacheStyle.backgroundSize === undefined) {\n __cacheStyle.backgroundSize = true;\n computedStyle.backgroundSize = calBackgroundSize(currentStyle.backgroundSize, innerWidth, innerHeight);\n }\n if(__cacheStyle.backgroundImage === undefined) {\n let backgroundImage = computedStyle.backgroundImage = currentStyle.backgroundImage;\n // 防止隐藏不加载背景图\n if(util.isString(backgroundImage)) {\n __cacheStyle.backgroundImage = true;\n let loadBgi = this.__loadBgi;\n let cache = inject.IMG[backgroundImage];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = backgroundImage;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n if(loadBgi.url !== backgroundImage) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = backgroundImage;\n loadBgi.source = null;\n inject.measureImg(backgroundImage, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.__isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n let node = this;\n node.__cancelCacheSvg();\n let root = node.root;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n before() {\n root.__addUpdate({\n node,\n focus: level.REPAINT,\n });\n },\n });\n }\n }, {\n width: innerWidth,\n height: innerHeight,\n });\n }\n }\n else if(backgroundImage && backgroundImage.k) {\n __cacheStyle.backgroundImage = this.__gradient(renderMode, ctx, defs, x2, y2, x3, y3, innerWidth, innerHeight, backgroundImage);\n }\n }\n if(__cacheStyle.boxShadow === undefined) {\n __cacheStyle.boxShadow = true;\n computedStyle.boxShadow = currentStyle.boxShadow;\n }\n // 这些直接赋值的不需要再算缓存\n [\n 'opacity',\n 'zIndex',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundRepeat',\n 'filter',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n [\n 'backgroundColor',\n 'borderTopColor',\n 'borderRightColor',\n 'borderBottomColor',\n 'borderLeftColor',\n ].forEach(k => {\n if(__cacheStyle[k] === undefined) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k].value);\n }\n });\n // 强制计算继承性的\n if(parent) {\n let parentComputedStyle = parent.computedStyle;\n [\n 'fontStyle',\n 'color',\n 'visibility',\n 'pointerEvents',\n ].forEach(k => {\n if(currentStyle[k].unit === INHERIT) {\n computedStyle[k] = parentComputedStyle[k];\n }\n else {\n computedStyle[k] = currentStyle[k].value;\n }\n if(k === 'color') {\n __cacheStyle.color = int2rgba(computedStyle.color);\n }\n });\n }\n // root和component的根节点不能是inherit\n else {\n [\n 'fontStyle',\n 'color',\n 'visibility',\n 'pointerEvents',\n ].forEach(k => {\n if(currentStyle[k].unit !== INHERIT) {\n computedStyle[k] = currentStyle[k].value;\n if(k === 'color') {\n __cacheStyle.color = int2rgba(computedStyle.color)\n }\n }\n });\n if(currentStyle.fontStyle.unit === INHERIT) {\n computedStyle.fontStyle = 'normal';\n }\n if(currentStyle.fontWeight.unit === INHERIT) {\n computedStyle.fontWeight = 400;\n }\n if(currentStyle.color.unit === INHERIT) {\n computedStyle.color = [0, 0, 0, 1];\n __cacheStyle.color = 'rgba(0,0,0,1)';\n }\n if(currentStyle.visibility.unit === INHERIT) {\n computedStyle.visibility = 'visible';\n }\n if(currentStyle.pointerEvents.unit === INHERIT) {\n computedStyle.pointerEvents = 'auto';\n }\n }\n // 圆角边计算\n if(__cacheStyle.borderTopLeftRadius === undefined\n || __cacheStyle.borderTopRightRadius === undefined\n || __cacheStyle.borderBottomRightRadius === undefined\n || __cacheStyle.borderBottomLeftRadius === undefined) {\n __cacheStyle.borderTopLeftRadius\n = __cacheStyle.borderTopRightRadius\n = __cacheStyle.borderBottomRightRadius\n = __cacheStyle.borderBottomLeftRadius\n = true;\n calBorderRadius(outerWidth, outerHeight, currentStyle, computedStyle);\n }\n let {\n backgroundColor,\n borderTopColor,\n borderTopStyle,\n borderRightColor,\n borderRightStyle,\n borderBottomColor,\n borderBottomStyle,\n borderLeftColor,\n borderLeftStyle,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n backgroundRepeat,\n backgroundImage,\n opacity,\n filter,\n backgroundSize,\n transformOrigin,\n transform,\n boxShadow,\n } = computedStyle;\n let p = parent || this.host && this.host.parent;\n // 先设置透明度,canvas可以向上累积\n if(renderMode === mode.CANVAS) {\n if(p) {\n opacity *= p.__opacity;\n }\n this.__opacity = opacity;\n if(ctx.globalAlpha !== opacity) {\n ctx.globalAlpha = opacity;\n }\n }\n else {\n this.__virtualDom.opacity = opacity;\n }\n // 省略计算\n let matrix;\n if(matrixCache) {\n matrix = matrixCache;\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += x;\n tfo[1] += y;\n matrix = transform;\n matrix = __cacheStyle.matrix = tf.calMatrixByOrigin(matrix, tfo);\n }\n let renderMatrix = this.__svgMatrix = matrix;\n // 变换对事件影响,canvas要设置渲染\n if(p) {\n matrix = mx.multiply(p.matrixEvent, matrix);\n }\n this.__matrixEvent = matrix;\n if(renderMode === mode.CANVAS) {\n ctx.setTransform(...matrix);\n }\n else if(renderMode === mode.SVG) {\n if(!equalArr(renderMatrix, [1, 0, 0, 1, 0, 0])) {\n this.virtualDom.transform = 'matrix(' + joinArr(renderMatrix, ',') + ')';\n }\n }\n // 隐藏不渲染,但要加载背景图\n if(visibility === 'hidden') {\n return;\n }\n // canvas的blur需绘制到离屏上应用后反向绘制回来\n let offScreen;\n if(filter && renderMode === mode.CANVAS) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let { width, height } = this.root;\n let c = inject.getCacheCanvas(width, height, '__$$blur$$__');\n if(c.ctx) {\n offScreen = {\n ctx,\n };\n offScreen.target = c;\n ctx = c.ctx;\n }\n }\n });\n }\n // 背景色垫底\n if(backgroundColor[3] > 0) {\n renderBgc(renderMode, __cacheStyle.backgroundColor, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n if(util.isString(backgroundImage)) {\n let loadBgi = this.__loadBgi;\n if(loadBgi.url === backgroundImage) {\n let source = loadBgi.source;\n // 无source不绘制\n if(source) {\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize;\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > innerWidth && height > innerHeight) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w >= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(width > innerWidth) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(height > innerHeight) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(innerWidth > width && innerHeight > height) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(innerWidth > width) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(innerHeight > height) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = x2 + calBackgroundPosition(backgroundPositionX, innerWidth, w);\n let bgY = y2 + calBackgroundPosition(backgroundPositionY, innerHeight, h);\n // 超出尺寸模拟mask截取\n let needMask = bgX < x2 || bgY < y2 || w > innerWidth || h > innerHeight;\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgX - x2;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = x2 + innerWidth - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgY - y2;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = y2 + innerHeight - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < x2) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > x2 + innerWidth) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < y2) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > y2 + innerHeight) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n if(needMask) {\n ctx.save();\n renderBgc(renderMode, '#FFF', x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, innerWidth, innerHeight);\n let props = [\n ['xlink:href', backgroundImage],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height]\n ];\n let needResize;\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(matrix, ',') + ')']);\n }\n if(needMask) {\n let id = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'rect',\n props: [\n ['x', x2],\n ['y', y2],\n ['width', innerWidth],\n ['height', innerHeight],\n ['fill', '#FFF']\n ],\n }],\n });\n this.virtualDom.bbClip = 'url(#' + id + ')';\n }\n // 先画不考虑repeat的中心声明的\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], innerWidth, innerHeight);\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n copy[5][1] = 'matrix(' + joinArr(matrix, ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n }\n else if(backgroundImage.k) {\n renderBgc(renderMode, __cacheStyle.backgroundImage, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n renderBoxShadow(renderMode, ctx, defs, item, this, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let points = border.calPoints(borderTopWidth, borderTopStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 0,\n borderTopLeftRadius, borderTopRightRadius);\n renderBorder(renderMode, points, __cacheStyle.borderTopColor, ctx, this);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n let points = border.calPoints(borderRightWidth, borderRightStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 1,\n borderTopRightRadius, borderBottomRightRadius);\n renderBorder(renderMode, points, __cacheStyle.borderRightColor, ctx, this);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let points = border.calPoints(borderBottomWidth, borderBottomStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 2,\n borderBottomLeftRadius, borderBottomRightRadius);\n renderBorder(renderMode, points, __cacheStyle.borderBottomColor, ctx, this);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let points = border.calPoints(borderLeftWidth, borderLeftStyle, deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 3,\n borderTopLeftRadius, borderBottomLeftRadius);\n renderBorder(renderMode, points, __cacheStyle.borderLeftColor, ctx, this);\n }\n if(filter) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n if(renderMode === mode.CANVAS) {\n offScreen.blur = v;\n }\n else if(renderMode === mode.SVG) {\n // 模糊框卷积尺寸 #66\n let d = mx.int2convolution(v);\n let id = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feGaussianBlur',\n props: [\n ['stdDeviation', v],\n ],\n }\n ],\n });\n this.virtualDom.filter = 'url(#' + id + ')';\n }\n }\n });\n }\n return offScreen;\n }\n\n __renderByMask(renderMode, ctx, defs) {\n let { next, root } = this;\n let hasMask = next && next.isMask;\n let hasClip = next && next.isClip;\n if(!hasMask && !hasClip) {\n this.render(renderMode, ctx, defs);\n return;\n }\n if(renderMode === mode.CANVAS) {\n // canvas借用2个离屏canvas来处理,c绘制本xom,m绘制多个mask\n if(hasMask) {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$mask1$$__');\n this.render(renderMode, c.ctx);\n // 收集之前的mask列表\n let list = [];\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n // 当mask只有1个时,无需生成m,直接在c上即可\n if(list.length === 1) {\n next = list[0];\n c.ctx.globalCompositeOperation = 'destination-in';\n next.render(renderMode, c.ctx);\n // 为小程序特殊提供的draw回调,每次绘制调用都在攒缓冲,drawImage另一个canvas时刷新缓冲,需在此时主动flush\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n }\n // 多个借用m绘制mask,用c结合mask获取结果,最终结果再到当前画布\n else {\n let m = inject.getCacheCanvas(width, height, '__$$mask2$$__');\n list.forEach(item => {\n item.render(renderMode, m.ctx);\n });\n m.draw(m.ctx);\n c.ctx.globalCompositeOperation = 'destination-in';\n c.ctx.drawImage(m.canvas, 0, 0);\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n // 清除\n m.ctx.globalCompositeOperation = 'source-over';\n m.ctx.clearRect(0, 0, width, height);\n m.draw(m.ctx);\n }\n ctx.restore();\n // 清除\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, width, height);\n c.draw(c.ctx);\n }\n // 劫持canvas原生方法使得多个clip矢量连续绘制\n else if(hasClip) {\n ctx.save();\n ctx.beginPath();\n let fill = ctx.fill;\n let beginPath = ctx.beginPath;\n let closePath = ctx.closePath;\n ctx.fill = ctx.beginPath = ctx.closePath = empty;\n while(next && next.isClip) {\n next.render(renderMode, ctx);\n next = next.next;\n }\n ctx.fill = fill;\n ctx.beginPath = beginPath;\n ctx.closePath = closePath;\n ctx.clip();\n ctx.closePath();\n this.render(renderMode, ctx);\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n this.render(renderMode, ctx, defs);\n // 检查后续mask是否是空,空遮罩不生效\n let isEmpty = true;\n let sibling = next;\n outer:\n while(sibling) {\n let { children } = sibling.virtualDom;\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n for(let j = 0, len = props.length; j < len; j++) {\n let [k, v] = props[i];\n if(k === 'd') {\n if(v) {\n isEmpty = false;\n break outer;\n }\n }\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n if(isEmpty) {\n return;\n }\n // 应用mask本身的matrix,以及被遮罩对象的matrix逆\n sibling = next;\n let mChildren = [];\n while(sibling) {\n let { children } = sibling.virtualDom;\n mChildren = mChildren.concat(children);\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n let matrix = sibling.svgMatrix;\n let inverse = mx.inverse(this.svgMatrix);\n matrix = mx.multiply(matrix, inverse);\n // transform属性放在最后一个省去循环\n let len = props.length;\n if(!len || props[len - 1][0] !== 'transform') {\n props.push(['transform', `matrix(${matrix})`]);\n }\n else {\n props[len - 1][1] = `matrix(${matrix})`;\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n let id = defs.add({\n tagName: hasClip ? 'clipPath' : 'mask',\n props: [],\n children: mChildren,\n });\n id = 'url(#' + id + ')';\n // 作为mask会在defs生成maskId供使用,多个连续mask共用一个id\n if(hasMask) {\n this.virtualDom.mask = id;\n }\n else if(hasClip) {\n this.virtualDom.clip = id;\n }\n }\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n let ref = this.props.ref;\n if(ref) {\n let owner = this.host || this.root;\n if(owner && owner.ref[ref]) {\n delete owner.ref[ref];\n }\n }\n this.animationList.forEach(item => item.__destroy());\n this.root.delRefreshTask(this.__loadBgi.cb);\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__matrix = this.__matrixEvent = this.__root = null;\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n e.target = this;\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e) {\n let { x, y } = e;\n let { sx, sy, outerWidth, outerHeight, matrixEvent,\n computedStyle: { pointerEvents } } = this;\n if(pointerEvents === 'none') {\n return;\n }\n let inThis = tf.pointInQuadrilateral(\n x, y,\n sx, sy,\n sx + outerWidth, sy,\n sx + outerWidth, sy + outerHeight,\n sx, sy + outerHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root.__touchstartTarget = this;\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, defs, x2, y2, x3, y3, iw, ih, vs) {\n let { k, v, d, s, z, p } = vs;\n let cx = x2 + iw * 0.5;\n let cy = y2 + ih * 0.5;\n let res;\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, cx, cy, iw, ih);\n res = this.__getLg(renderMode, ctx, defs, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, x2, y2, x3, y3);\n res = this.__getRg(renderMode, ctx, defs, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, defs, gd) {\n if(renderMode === mode.CANVAS) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], item[0]);\n });\n return lg;\n }\n else if(renderMode === mode.SVG) {\n let uuid = defs.add({\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2]\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', item[0]],\n ['offset', item[1] * 100 + '%']\n ],\n };\n }),\n });\n return 'url(#' + uuid + ')';\n }\n }\n\n __cancelCacheSvg() {\n this.__cacheSvg = false;\n }\n\n __cancelCache() {\n this.__cancelCacheSvg();\n this.__cacheStyle = {};\n }\n\n __getRg(renderMode, ctx, defs, gd) {\n if(renderMode === mode.CANVAS) {\n let rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.cx, gd.cy, gd.r);\n gd.stop.forEach(item => {\n rg.addColorStop(item[1], item[0]);\n });\n return rg;\n }\n else if(renderMode === mode.SVG) {\n let uuid = defs.add({\n tagName: 'radialGradient',\n props: [\n ['cx', gd.cx],\n ['cy', gd.cy],\n ['r', gd.r]\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', item[0]],\n ['offset', item[1] * 100 + '%']\n ],\n };\n }),\n });\n return 'url(#' + uuid + ')';\n }\n }\n\n updateStyle(style, cb) {\n let { tagName, root, props, style: os } = this;\n if(root) {\n let hasChange;\n // 先去掉缩写\n let ks = Object.keys(style);\n ks.forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n // 此处仅检测样式是否有效\n for(let i in style) {\n if(style.hasOwnProperty(i)) {\n // 是规定内的合法样式\n if(change.isValid(tagName, i)) {\n if(change.isGeom(tagName, i)) {\n if(!css.equalStyle(i, style[i], props[i], this)) {\n hasChange = true;\n }\n }\n else if(!css.equalStyle(i, style[i], os[i], this)) {\n hasChange = true;\n }\n }\n else {\n delete style[i];\n }\n }\n }\n // 空样式或非法或无改变直接返回\n if(!hasChange) {\n if(util.isFunction(cb)) {\n cb(0);\n }\n return;\n }\n let node = this;\n root.addRefreshTask(node.__task = {\n before() {\n if(node.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node,\n style,\n origin: true, // 标识样式未经过normalize,不同于animate\n overwrite: true, // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n });\n },\n after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n }\n\n animate(list, options) {\n if(this.isDestroyed) {\n return;\n }\n let animation = new Animation(this, list, options);\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n css.computeMeasure(this, isHost);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n deepScan(cb, options) {\n return cb(this, options);\n }\n\n __resizeX(dx) {\n this.computedStyle.width = this.__width += dx;\n }\n\n __resizeY(dy) {\n this.computedStyle.height = this.__height += dy;\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get innerWidth() {\n let {\n computedStyle: {\n display,\n paddingRight,\n paddingLeft,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.width\n + paddingLeft\n + paddingRight;\n }\n\n get innerHeight() {\n let {\n computedStyle: {\n display,\n paddingTop,\n paddingBottom,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.height\n + paddingTop\n + paddingBottom;\n }\n\n get outerWidth() {\n let {\n computedStyle: {\n display,\n borderLeftWidth,\n borderRightWidth,\n marginRight,\n marginLeft,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerWidth\n + borderLeftWidth\n + borderRightWidth\n + marginLeft\n + marginRight;\n }\n\n get outerHeight() {\n let {\n computedStyle: {\n display,\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n }\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerHeight\n + borderTopWidth\n + borderBottomWidth\n + marginTop\n + marginBottom;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__matrix;\n }\n\n get matrixEvent() {\n return this.__matrixEvent;\n }\n\n get svgMatrix() {\n return this.__svgMatrix;\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get layoutData() {\n return this.__layoutData;\n }\n\n}\n\nexport default Xom;\n","class LineGroup {\n constructor(x, y) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__baseLine = 0;\n }\n\n add(item) {\n this.list.push(item);\n }\n\n __calBaseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return baseLine;\n }\n\n verticalAlign() {\n let n = this.__baseLine = this.__calBaseLine();\n // 仅当有2个和以上时才需要vertical对齐调整\n if(this.list.length > 1) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n horizonAlign(diff) {\n this.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n\n get list() {\n return this.__list;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n let width = 0;\n this.list.forEach(item => {\n width += item.outerWidth;\n });\n return width;\n }\n\n get height() {\n let height = 0;\n this.list.forEach(item => {\n height = Math.max(height, item.outerHeight);\n });\n return height;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get marginBottom() {\n let n = 0;\n this.list.forEach(item => {\n n = Math.max(n, item.computedStyle.marginBottom);\n });\n return n;\n }\n}\n\nexport default LineGroup;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flattenJson({\n children: cd,\n $$type: TYPE_VD,\n });\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\n\nfunction initCp(json, root, owner) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n let vd = build(json, root, owner, owner);\n if(Array.isArray(vd)) {\n relation(owner, vd);\n }\n return vd;\n }\n else {\n return new Text(json);\n }\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param owner\n * @param host\n * @returns vd\n */\nfunction build(json, root, owner, host) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, owner, host));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, inherit, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_PL) {\n return json.value;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'div' || tagName === 'span') {\n vd = new Dom(tagName, props);\n }\n else if(tagName === 'img') {\n vd = new Img(tagName, props);\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, owner, host));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = vd.__tagName || tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用\n json.vd = vd;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = vd;\n });\n }\n // 更新过程中key相同的vd继承动画\n if(inherit) {\n util.extendAnimate(inherit, vd);\n }\n vd.__root = root;\n if(host) {\n vd.__host = host;\n }\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n owner.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children.children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && (children.$$type === TYPE_CP || children.$$type === TYPE_PL)) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n if(children instanceof Dom) {\n relation(children, children.children);\n }\n // 文字视作为父节点的直接文字子节点\n else if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initCp,\n flattenJson,\n relation,\n build,\n};\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.__state = {};\n this.__isMounted = false;\n }\n\n setState(n, cb) {\n if(isNil(n)) {\n n = {};\n }\n else {\n let state = clone(this.state);\n n = extend(state, n);\n }\n let root = this.root;\n if(root && this.__isMounted) {\n root.delRefreshTask(this.__task);\n this.__task = {\n before: () => {\n // 标识更新\n this.__nextState = n;\n setUpdateFlag(this);\n },\n after: () => {\n if(isFunction(cb)) {\n cb();\n }\n },\n __state: true, // 特殊标识来源让root刷新时识别\n };\n root.addRefreshTask(this.__task);\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n this.__state = n;\n cb();\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n let root = this.root;\n let cd = json || builder.flattenJson(this.render());\n let sr = builder.initCp(cd, root, this, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n console.warn('Component render() return a text, should not inherit style/event');\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr,以及自定义事件\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n }\n else if(sr instanceof Component) {\n // 本身build是递归的,子cp已经初始化了\n console.warn('Component render() return a component: '\n + this.tagName + ' -> ' + sr.tagName\n + ', should not inherit style/event');\n }\n else {\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n sr.__host = this;\n this.__shadowRoot = sr;\n if(!this.__isMounted) {\n this.__isMounted = true;\n let { componentDidMount } = this;\n if(isFunction(componentDidMount)) {\n root.once(Event.REFRESH, () => {\n componentDidMount.call(this);\n });\n }\n }\n }\n\n render() {\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n let { componentWillUnmount } = this;\n if(isFunction(componentWillUnmount)) {\n componentWillUnmount.call(this);\n this.__isMounted = false;\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__shadowRoot = null;\n this.__parent = null;\n }\n\n __emitEvent(e) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n sr.__computeMeasure(renderMode, ctx);\n }\n // 其它类型为Xom或Component\n else {\n sr.__computeMeasure(renderMode, ctx, true, cb);\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'style',\n 'animating',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'animateProps',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n 'layoutData',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n '__cancelCacheSvg',\n 'deepScan',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineGroup from './LineGroup';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport blur from '../style/blur';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__lineGroups = []; // 一行inline元素组成的LineGroup对象后的存放列表\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style.fontWeight && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n }\n\n // 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Xom || item instanceof Component) {\n w -= item.__tryLayInline(w, total);\n }\n else {\n w -= item.textWidth;\n }\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout);\n }\n });\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout);\n }\n });\n }\n\n __calAutoBasis(isDirectionRow, w, h, isRecursion) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n marginLeft,\n marginTop,\n marginRight,\n marginBottom,\n paddingLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit === PX) {\n b = max = main.value;\n // 递归时children的长度会影响flex元素的最小宽度\n if(isRecursion) {\n min = b;\n }\n }\n // 递归children取最大值\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { b: b2, min: min2, max: max2 } = item.__calAutoBasis(isDirectionRow, w, h, true);\n b = Math.max(b, b2);\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n // 文本水平\n else if(isDirectionRow) {\n min = Math.max(item.charWidth, min);\n max = Math.max(item.textWidth, max);\n }\n // 文本垂直\n else {\n css.computeReflow(item);\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n // margin/padding/border也得计算在内,此时还没有,百分比相对于父flex元素的宽度\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth.value + borderRightWidth.value + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth.value + borderBottomWidth.value + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return { b, min, max };\n }\n\n // 换算margin/padding为px单位\n __calMp(v, w) {\n let n = 0;\n if(v.unit === PX) {\n n += v.value;\n }\n else if(v.unit === PERCENT) {\n v.value *= w * 0.01;\n v.unit = PX;\n n += v.value;\n }\n return n;\n }\n\n // 本身block布局时计算好所有子元素的基本位置\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, lineGroups } = this;\n lineGroups.splice(0);\n let {\n textAlign,\n } = computedStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 递归布局,将inline的节点组成lineGroup一行\n let lineGroup = new LineGroup(x, y);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(item.currentStyle.display === 'inline') {\n // inline开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.outerWidth;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x, w);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.outerWidth;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.outerWidth;\n }\n }\n }\n else {\n // block/flex先处理之前可能的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n y += lineGroup.height + lineGroup.marginBottom;\n lineGroup = new LineGroup(data.x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n x = data.x;\n y += item.outerHeight;\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n }\n }\n // 文字和inline类似\n else {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.width;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.width;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.width;\n }\n }\n }\n });\n // 结束后处理可能遗留的最后的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n // flex/abs的虚拟前置布局,无需真正计算\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n else {\n maxW = Math.max(maxW, cw);\n }\n y += lineGroup.height;\n }\n this.__width = fixedWidth || !isVirtual ? w : maxW;\n this.__height = fixedHeight ? h : y - data.y;\n if(lineGroup.size) {\n y += lineGroup.marginBottom;\n }\n // text-align\n if(!isVirtual && ['center', 'right'].indexOf(textAlign) > -1) {\n lineGroups.forEach(lineGroup => {\n let diff = w - lineGroup.width;\n if(diff > 0) {\n lineGroup.horizonAlign(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n if(!isVirtual) {\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle } = this;\n let {\n flexDirection,\n justifyContent,\n alignItems,\n } = currentStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n let maxX = 0;\n let isDirectionRow = flexDirection === 'row';\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let minList = [];\n let growSum = 0;\n let shrinkSum = 0;\n let basisSum = 0;\n let maxSum = 0;\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n // abs虚拟布局计算时纵向也是看横向宽度\n let { b, min, max } = item.__calAutoBasis(isVirtual ? true : isDirectionRow, w, h);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { currentStyle, computedStyle } = item;\n let { flexGrow, flexShrink, flexBasis } = currentStyle;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n growSum += flexGrow;\n shrinkSum += flexShrink;\n // 根据basis不同,计算方式不同\n if(flexBasis.unit === AUTO) {\n basisList.push(max);\n basisSum += max;\n }\n else if(flexBasis.unit === PX) {\n computedStyle.flexBasis = b = flexBasis.value;\n basisList.push(b);\n basisSum += b;\n }\n else if(flexBasis.unit === PERCENT) {\n b = computedStyle.flexBasis = (isDirectionRow ? w : h) * flexBasis.value * 0.01;\n basisList.push(b);\n basisSum += b;\n }\n maxSum += max;\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n shrinkSum += 1;\n if(isDirectionRow) {\n basisList.push(item.textWidth);\n basisSum += item.textWidth;\n maxSum += item.textWidth;\n minList.push(item.charWidth);\n }\n else {\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n basisList.push(item.height);\n basisSum += item.height;\n maxSum += item.height;\n minList.push(item.height);\n }\n }\n });\n if(isVirtual) {\n this.__width = Math.min(maxX, w);\n return;\n }\n let maxCross = 0;\n // 判断是否超出,决定使用grow还是shrink\n let isOverflow = maxSum > (isDirectionRow ? w : h);\n flowChildren.forEach((item, i) => {\n let main;\n let shrink = shrinkList[i];\n let grow = growList[i];\n // 计算主轴长度\n if(isOverflow) {\n let overflow = basisSum - (isDirectionRow ? w : h);\n main = shrink ? (basisList[i] - overflow * shrink / shrinkSum) : basisList[i];\n }\n else {\n let free = (isDirectionRow ? w : h) - basisSum;\n main = grow ? (basisList[i] + free * grow / growSum) : basisList[i];\n }\n // 主轴长度的最小值不能小于元素的最小长度,比如横向时的字符宽度\n main = Math.max(main, minList[i]);\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n let {\n display,\n flexDirection,\n width,\n height,\n } = currentStyle;\n // flex的child如果是inline,变为block\n if(display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n if(isDirectionRow) {\n // 横向flex的child如果是竖向flex,高度自动的话要等同于父flex的高度\n if(display === 'flex' && flexDirection === 'column' && fixedHeight && height.unit === AUTO) {\n height.value = h;\n height.unit = PX;\n }\n item.__layout({\n x,\n y,\n w: main,\n h,\n });\n }\n else {\n // 竖向flex的child如果是横向flex,宽度自动的话要等同于父flex的宽度\n if(display === 'flex' && flexDirection === 'row' && width.unit === AUTO) {\n width.value = w;\n width.unit = PX;\n }\n item.__layout({\n x,\n y,\n w,\n h: main,\n });\n }\n // 重设因伸缩而导致的主轴长度\n if(isOverflow && shrink || !isOverflow && grow) {\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n if(isDirectionRow) {\n item.__width = main - marginLeft - marginRight - paddingLeft - paddingRight - borderLeftWidth - borderRightWidth;\n }\n else {\n item.__height = main - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n }\n else {\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? w - x + data.x : h - y + data.y;\n // 主轴侧轴对齐方式\n if(!isOverflow && growSum === 0 && diff > 0) {\n let len = flowChildren.length;\n if(justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n // 子元素侧轴伸展\n if(isDirectionRow) {\n // 父元素固定高度,子元素可能超过,侧轴最大长度取固定高度\n if(fixedHeight) {\n maxCross = h;\n }\n y += maxCross;\n }\n else {\n if(fixedWidth) {\n maxCross = w;\n }\n }\n // 侧轴对齐\n if(!isVirtual) {\n if(alignItems === 'stretch') {\n // 短侧轴的children伸张侧轴长度至相同,超过的不动,固定宽高的也不动\n flowChildren.forEach(item => {\n let { computedStyle, currentStyle } = item;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n if(isDirectionRow) {\n if(currentStyle.height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n if(currentStyle.width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\n });\n }\n else if(alignItems === 'center') {\n flowChildren.forEach(item => {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n });\n }\n else if(alignItems === 'flex-end') {\n flowChildren.forEach(item => {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n });\n }\n }\n this.__width = w;\n this.__height = fixedHeight ? h : y - data.y;\n this.__marginAuto(currentStyle, data);\n }\n\n // inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n __layoutInline(data, isVirtual) {\n let { flowChildren, computedStyle, lineGroups } = this;\n lineGroups.splice(0);\n let {\n textAlign,\n } = computedStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 递归布局,将inline的节点组成lineGroup一行\n let lineGroup = new LineGroup(x, y);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(item.computedStyle.display !== 'inline') {\n item.currentStyle.display = item.computedStyle.display = 'inline';\n console.error('Inline can not contain block/flex');\n }\n // inline开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item); console.log('inline');\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.outerWidth;\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x, w);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n x = data.x;\n y += lineGroup.height;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n x += item.outerWidth;\n lineGroup.add(item);\n cw += item.outerWidth;\n }\n }\n // inline里的其它只有文本\n else {\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.width;\n maxW = Math.max(maxW, cw);\n cw = item.width;\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n x = data.x;\n y += lineGroup.height;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n x += item.width;\n lineGroup.add(item);\n cw += item.width;\n }\n }\n });\n // 结束后处理可能遗留的最后的lineGroup,children为空时可能size为空\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n // flex/abs的虚拟前置布局,无需真正计算\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n y += lineGroup.height;\n maxW = Math.max(maxW, cw);\n }\n // 元素的width不能超过父元素w\n this.__width = fixedWidth ? w : maxW;\n this.__height = fixedHeight ? h : y - data.y;\n // text-align\n if(!isVirtual && ['center', 'right'].indexOf(textAlign) > -1) {\n lineGroups.forEach(lineGroup => {\n let diff = this.__width - lineGroup.width;\n if(diff > 0) {\n lineGroup.horizonAlign(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, innerWidth, innerHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n display,\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingLeft,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target && target !== item) {\n return;\n }\n let { currentStyle, computedStyle } = item;\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, innerWidth);\n if(computedStyle.display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n let { left, top, right, bottom, width, height, display, flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left.unit !== AUTO) {\n fixedLeft = true;\n computedStyle.left = calAbsolute(currentStyle, 'left', left, innerWidth);\n }\n else {\n computedStyle.left = 'auto';\n }\n if(right.unit !== AUTO) {\n fixedRight = true;\n computedStyle.right = calAbsolute(currentStyle, 'right', right, innerWidth);\n }\n else {\n computedStyle.right = 'auto';\n }\n if(top.unit !== AUTO) {\n fixedTop = true;\n computedStyle.top = calAbsolute(currentStyle, 'top', top, innerHeight);\n }\n else {\n computedStyle.top = 'auto';\n }\n if(bottom.unit !== AUTO) {\n fixedBottom = true;\n computedStyle.bottom = calAbsolute(currentStyle, 'bottom', bottom, innerHeight);\n }\n else {\n computedStyle.bottom = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle.left;\n w2 = x + innerWidth - computedStyle.right - x2;\n }\n else if(fixedLeft && width.unit !== AUTO) {\n x2 = x + computedStyle.left;\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n else if(fixedRight && width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n x2 = x + innerWidth - computedStyle.right - w2;\n // 右对齐有尺寸时y值还需减去margin/border/padding的\n x2 -= computedStyle.marginLeft;\n x2 -= computedStyle.marginRight;\n x2 -= computedStyle.paddingLeft;\n x2 -= computedStyle.paddingRight;\n x2 -= currentStyle.borderLeftWidth.value;\n x2 -= currentStyle.borderRightWidth.value;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle.left;\n }\n else if(fixedRight) {\n x2 = x + innerWidth - computedStyle.right;\n onlyRight = true;\n }\n else {\n x2 = x + paddingLeft;\n if(width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle.top;\n h2 = y + innerHeight - computedStyle.bottom - y2;\n }\n else if(fixedTop && height.unit !== AUTO) {\n y2 = y + computedStyle.top;\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n else if(fixedBottom && height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n y2 = y + innerHeight - computedStyle.bottom - h2;\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle.marginTop;\n y2 -= computedStyle.marginBottom;\n y2 -= computedStyle.paddingTop;\n y2 -= computedStyle.paddingBottom;\n y2 -= currentStyle.borderTopWidth.value;\n y2 -= currentStyle.borderBottomWidth.value;\n }\n else if(fixedTop) {\n y2 = y + computedStyle.top;\n }\n else if(fixedBottom) {\n y2 = y + innerHeight - computedStyle.bottom;\n onlyBottom = true;\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y;\n let prev = item.prev;\n while(prev) {\n if(prev instanceof Text || prev.computedStyle.position !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(!prev) {\n y2 = y;\n }\n if(height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if(display === 'block' && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : innerWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : innerHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n if(target) {\n return;\n }\n // 递归进行,遇到absolute/relative的设置新容器\n children.forEach(item => {\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n }\n\n render(renderMode, ctx, defs) {\n let offScreen = super.render(renderMode, ctx, defs);\n if(offScreen && offScreen.target && offScreen.target.ctx) {\n ctx = offScreen.target.ctx;\n }\n // 降级\n else {\n offScreen = null;\n }\n // 不显示的为了diff也要根据type生成\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'dom';\n }\n let { isDestroyed, computedStyle: { display }, children } = this;\n if(isDestroyed || display === 'none' || !children.length) {\n return;\n }\n // 先渲染过滤mask\n children.forEach(item => {\n if(item.isMask || item.isClip) {\n item.__renderAsMask(renderMode, ctx, defs, !item.isMask);\n }\n });\n // 按照zIndex排序绘制过滤mask,同时由于svg严格按照先后顺序渲染,没有z-index概念,需要排序将relative/absolute放后面\n let zIndex = this.zIndexChildren;\n zIndex.forEach(item => {\n item.__renderByMask(renderMode, ctx, defs);\n });\n // 模糊滤镜写回\n if(renderMode === mode.CANVAS && offScreen) {\n let { width, height } = this.root;\n let webgl = inject.getCacheWebgl(width, height);\n let res = blur.gaussBlur(offScreen.target, webgl, offScreen.blur, width, height);\n offScreen.ctx.drawImage(offScreen.target.canvas, 0, 0);\n offScreen.target.draw();\n res.clear();\n }\n // img的children在子类特殊处理\n else if(renderMode === mode.SVG && this.tagName !== 'img') {\n this.virtualDom.children = zIndex.map(item => item.virtualDom);\n // 没变化则将text孩子设置cache\n if(this.virtualDom.cache) {\n this.virtualDom.children.forEach(item => {\n if(item.type === 'text') {\n item.cache = true;\n }\n });\n }\n }\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param isHost\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, isHost, cb) {\n super.__computeMeasure(renderMode, ctx, isHost, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, false, cb);\n });\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n this.children.splice(0);\n this.lineGroups.splice(0);\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n }\n // child不触发再看自己\n return super.__emitEvent(e);\n }\n\n __cancelCacheSvg(recursion) {\n super.__cancelCacheSvg();\n if(recursion) {\n this.children.forEach(child => {\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n child.__cancelCacheSvg(recursion);\n }\n });\n }\n }\n\n __cancelCache(recursion) {\n super.__cancelCache();\n if(recursion) {\n this.children.forEach(child => {\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n child.__cancelCache(recursion);\n }\n });\n }\n }\n\n // 深度遍历执行所有子节点,包含自己,如果cb返回true,提前跳出不继续深度遍历\n deepScan(cb, options) {\n if(super.deepScan(cb, options)) {\n return;\n }\n this.children.forEach(node => {\n node.deepScan(cb, options);\n });\n }\n\n get children() {\n return this.__children;\n }\n\n get flowChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Text || item.currentStyle.position !== 'absolute';\n });\n }\n\n get absChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Xom && item.currentStyle.position === 'absolute';\n });\n }\n\n get zIndexChildren() {\n let flow = [];\n let abs = [];\n let needSort = false;\n let lastIndex;\n this.children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 不是遮罩,并且已有computedStyle,特殊情况下中途插入的节点还未渲染\n if(!item.isMask && !item.isClip && item.computedStyle) {\n if(item instanceof Xom) {\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__iIndex = i;\n let z = child.__zIndex = item.currentStyle.zIndex;\n abs.push(child);\n if(lastIndex === undefined) {\n lastIndex = z;\n }\n else if(!needSort) {\n if(z < lastIndex) {\n needSort = true;\n }\n lastIndex = z;\n }\n }\n else {\n flow.push(child);\n }\n }\n else {\n flow.push(child);\n }\n }\n });\n needSort && abs.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n return a.__iIndex - b.__iIndex;\n });\n return flow.concat(abs);\n }\n\n get lineGroups() {\n return this.__lineGroups;\n }\n\n get baseLine() {\n let len = this.lineGroups.length;\n if(len) {\n let last = this.lineGroups[len - 1];\n return last.y - this.y + last.baseLine;\n }\n return this.y;\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport transform from '../style/transform';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\n\nconst { AUTO } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {};\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = this.props.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.url = src;\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n }\n\n render(renderMode, ctx, defs) {\n super.render(renderMode, ctx, defs);\n let {\n sx: x, sy: y, width, height, isDestroyed,\n props: {\n src,\n },\n computedStyle: {\n display,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n }\n } = this;\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let originX = x + marginLeft + borderLeftWidth + paddingLeft;\n let originY = y + marginTop + borderTopWidth + paddingTop;\n let loadImg = this.__loadImg;\n if(loadImg.error) {\n let strokeWidth = Math.min(width, height) * 0.02;\n let stroke = '#CCC';\n let fill = '#DDD';\n let cx = originX + width * 0.7;\n let cy = originY + height * 0.3;\n let r = strokeWidth * 5;\n let pts = [\n [originX + width * 0.15, originY + height * 0.7],\n [originX + width * 0.3, originY + height * 0.4],\n [originX + width * 0.5, originY + height * 0.6],\n [originX + width * 0.6, originY + height * 0.5],\n [originX + width * 0.9, originY + height * 0.8],\n [originX + width * 0.15, originY + height * 0.8]\n ];\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.beginPath();\n ctx.moveTo(originX, originY);\n ctx.lineTo(originX + width, originY);\n ctx.lineTo(originX + width, originY + height);\n ctx.lineTo(originX, originY + height);\n ctx.lineTo(originX, originY);\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.virtualDom.children = [];\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(loadImg.url === src) {\n let source = loadImg.source;\n // 无source不绘制\n if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n this.virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!this.virtualDom.cache && list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n this.virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n this.virtualDom.conClip = 'url(#' + id + ')';\n delete this.virtualDom.cache;\n }\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n props.push(['transform', 'matrix(' + util.joinArr(matrix, ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n this.virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n }\n else {\n let loadImg = this.__loadImg;\n loadImg.url = src;\n loadImg.source = null;\n loadImg.error = null;\n loadImg.cache = false;\n inject.measureImg(src, data => {\n let self = this;\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.url && !self.__isDestroyed) {\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else {\n loadImg.error = true;\n }\n let { root, currentStyle: { width, height } } = self;\n root.delRefreshTask(self.__task);\n if(width.unit !== AUTO && height.unit !== AUTO) {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REPAINT,\n img: true,\n });\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行\n img: true, // 特殊标识强制布局即便没有style变化 TODO\n });\n },\n });\n }\n }\n }, {\n width,\n height,\n });\n }\n }\n\n get baseLine() {\n return this.height;\n }\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n }\n add(data) {\n data.uuid = 'karas-defs-' + this.id + '-' + this.count++;\n this.list.push(data);\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import util from './util';\nimport builder from './builder';\nimport $$type from './$$type';\n\nconst { TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n}\n\n/**\n * 检查cp是否有state变更\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制更新\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n check(cp.shadowRoot);\n }\n }\n else {\n check(cp.shadowRoot);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.__state = state;\n cp.__nextState = null;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = builder.flattenJson(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldSr, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n while(sr instanceof Component) {\n sr = sr.shadowRoot;\n }\n sr.__width = oldSr.width;\n sr.__height = oldSr.height;\n sr.__computedStyle = oldSr.computedStyle;\n sr.__layoutData = oldSr.layoutData;\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || json.$$type !== TYPE_PL) {\n removeList.push(oldSr);\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.inherit = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建\n // 否则需要强制触发组件更新,包含setState内容\n nj.$$type = TYPE_PL;\n nj.value = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n console.error('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList = [];\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n updateList,\n check,\n checkCp,\n did,\n};\n","import util from './util';\n\nconst { joinVd, joinDef } = util;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n diffBb(cns[1], ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n diffD2D(elem, ovd, nvd, true);\n}\n\nfunction diffDefs(elem, od, nd) {\n let ol = od.length;\n let nl = nd.length;\n let i = 0;\n let cns = elem.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffDef(cns[i], od[i], nd[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, mask, clip, filter, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(ovd.clip) {\n elem.removeAttribute('clip-path');\n }\n }\n if(ovd.clip !== clip) {\n if(clip) {\n elem.setAttribute('clip-path', clip);\n }\n else {\n elem.removeAttribute('clip-path');\n }\n if(ovd.mask) {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter) {\n if(filter) {\n elem.setAttribute('filter', filter);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n if(!nvd.cache) {\n diffX2X(elem, ovd, nvd);\n if(!root) {\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n }\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffChild(cns[i], ovd.children[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(lastChild, i, ovd.children[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb, oClip, nClip) {\n let ol = obb.length;\n let nl = nbb.length;\n if(oClip !== nClip) {\n if(!nClip) {\n elem.removeAttribute('clip-path');\n }\n else {\n elem.setAttribute('clip-path', nClip);\n }\n }\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n add(v) {\n if(this.__list.indexOf(v) === -1) {\n this.list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(list = this.__records) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(list.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n list.splice(0).forEach(item => {\n let { target, animate } = item;\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n }\n });\n }\n }\n\n __playAuto() {\n this.init(this.__auto);\n this.__action('play');\n }\n\n play(cb) {\n this.init();\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n cancel(cb) {\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n get list() {\n return this.__list;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Component from './Component';\nimport Defs from './Defs';\nimport mode from './mode';\nimport builder from '../util/builder';\nimport updater from '../util/updater';\nimport util from '../util/util';\nimport diff from '../util/diff';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport Controller from '../animate/Controller';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\n\nconst { isNil, isObject, isFunction } = util;\nconst { AUTO, PX, PERCENT } = unit;\nconst { calRelative, isRelativeOrAbsolute } = css;\n\nfunction getDom(dom) {\n if(util.isString(dom) && dom) {\n let o = document.querySelector(dom);\n if(!o) {\n throw new Error('Can not find dom of selector: ' + dom);\n }\n return o;\n }\n if(!dom) {\n throw new Error('Can not find dom: ' + dom);\n }\n return dom;\n}\n\nfunction renderProp(k, v) {\n let s = Array.isArray(v) ? util.joinSourceArray(v) : util.stringify(v);\n if(k === 'className') {\n k = 'class';\n }\n return ' ' + k + '=\"' + util.encodeHtml(s, true) + '\"';\n}\n\nfunction initEvent(dom) {\n ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(type => {\n dom.addEventListener(type, e => {\n let root = dom.__root;\n if(['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1) {\n root.__touchstartTarget.__emitEvent(root.__wrapEvent(e), true);\n }\n else {\n root.__cb(e);\n }\n });\n });\n}\n\n// 提取出对比节点尺寸是否修改,用currentStyle的对比computedStyle的\nfunction isFixedWidthOrHeight(node, k) {\n let c = node.currentStyle[k];\n let v = node.computedStyle[k];\n if(c.unit === PX) {\n return c.value === v;\n }\n if(c.unit === PERCENT) {\n let s = node.parent.layoutData[k === 'width' ? 'w' : 'h'];\n return c.value * s * 0.01 === v;\n }\n return false;\n}\nfunction isFixedSize(node) {\n return isFixedWidthOrHeight(node, 'width') && isFixedWidthOrHeight(node, 'height');\n}\n\nfunction findParentNotComponent(node, root) {\n if(node === root || !node) {\n return node;\n }\n if(node.host) {\n return findParentNotComponent(node.host, root);\n }\n return node.parent;\n}\n\nconst OFFSET = 0;\nconst LAYOUT = 1;\nfunction isLAYOUT(node, hash) {\n return node.hasOwnProperty('__uniqueReflowId') && hash[node.__uniqueReflowId] >= LAYOUT;\n}\n\nfunction setLAYOUT(node, hash) {\n addLAYOUT(node, hash);\n hash[node.__uniqueReflowId].lv |= LAYOUT;\n}\n\nlet __uniqueReflowId = 0;\nfunction addLAYOUT(node, hash) {\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n hash[__uniqueReflowId++] = {\n node,\n lv: LAYOUT,\n };\n }\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__cd = children || []; // 原始children,再初始化过程中生成真正的dom\n this.__dom = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n this.__sx = 1; // 默认缩放,css改变canvas/svg缩放后影响事件坐标\n this.__sy = 1;\n this.__task = [];\n this.__ref = {};\n this.__updateList = [];\n this.__reflowList = [{ node: this }]; // 初始化填自己,第一次布局时复用逻辑完全重新布局\n this.__animateController = new Controller();\n Event.mix(this);\n }\n\n __initProps() {\n let w = this.props.width;\n if(!isNil(w)) {\n let value = parseFloat(w) || 0;\n if(value > 0) {\n this.__width = value;\n }\n }\n let h = this.props.height;\n if(!isNil(h)) {\n let value = parseFloat(h) || 0;\n if(value > 0) {\n this.__height = value;\n }\n }\n this.__offScreen = !!this.props.offScreen;\n }\n\n __genHtml() {\n let res = `<${this.tagName}`;\n // 拼接处理属性\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n });\n res += `>`;\n return res;\n }\n\n __wrapEvent(e) {\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { dom, __sx, __sy } = this;\n let { x: x2, y: y2, left, top } = dom.getBoundingClientRect();\n x = x2 || left || 0;\n y = y2 || top || 0;\n let { pageX, pageY } = e.touches ? e.touches[0] : e;\n x = pageX - x;\n y = pageY - y;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标\n if(__sx !== 1) {\n x /= __sx;\n }\n if(__sy !== 1) {\n y /= __sy;\n }\n }\n return {\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n e.stopPropagation();\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n e.stopImmediatePropagation();\n },\n preventDefault() {\n e.preventDefault();\n },\n x,\n y,\n __hasEmitted: false,\n };\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接响应\n __cb(e) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let data = this.__wrapEvent(e);\n this.__emitEvent(data);\n return data;\n }\n\n appendTo(dom) {\n dom = getDom(dom);\n this.__children = builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n // 已有root节点\n if(dom.nodeName.toUpperCase() === this.tagName.toUpperCase()) {\n this.__dom = dom;\n if(this.width) {\n dom.setAttribute('width', this.width);\n }\n if(this.height) {\n dom.setAttribute('height', this.height);\n }\n }\n // 没有canvas/svg节点则生成一个新的\n else {\n this.__dom = dom.querySelector(this.tagName);\n if(!this.__dom) {\n dom.innerHTML = this.__genHtml();\n this.__dom = dom.querySelector(this.tagName);\n }\n }\n this.__uuid = isNil(this.__dom.__uuid) ? uuid++ : this.__dom.__uuid;\n this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid);\n // 没有设置width/height则采用css计算形式\n if(!this.width || !this.height) {\n let css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root) {\n this.dom.__root.destroy();\n }\n else {\n initEvent(this.dom);\n this.dom.__uuid = this.__uuid;\n }\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,一般是同步,为了防止外部因素inject是异步写成了cb形式\n inject.measureText(() => {\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS) {\n this.__clear(ctx);\n }\n this.render(renderMode, ctx, defs);\n if(renderMode === mode.SVG) {\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__root) {\n diff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH);\n });\n }\n\n destroy() {\n this.__destroy();\n frame.offFrame(this.__rTask);\n let n = this.dom;\n if(n) {\n n.__root = null;\n }\n }\n\n scale(x = 1, y = x) {\n this.__sx = x;\n this.__sy = y;\n }\n\n addRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task, renderMode, ctx } = this;\n // 第一个添加延迟侦听,后续放队列等待一并执行\n if(!task.length) {\n let clone;\n frame.nextFrame(this.__rTask = {\n before: diff => {\n clone = task.splice(0);\n // 前置一般是动画计算此帧样式应用,然后刷新后出发frame事件,图片加载等同\n if(clone.length) {\n let setStateList = [];\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.before)) {\n // 收集组件setState的更新,特殊处理\n if(item.__state) {\n setStateList.push(i);\n }\n item.before(diff);\n }\n });\n // 刷新前先进行setState检查,全都是setState触发的且没有更新则无需刷新\n if(setStateList.length) {\n updater.check(this);\n }\n // 有组件更新,则需要重新布局\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let sr = cp.shadowRoot;\n while(sr instanceof Component) {\n sr = sr.shadowRoot;\n }\n this.__addUpdate({\n node: sr,\n style: sr.currentStyle,\n focus: level.REFLOW,\n measure: true, // 未知强制measure\n });\n });\n this.refresh();\n }\n // 有可能组件都不需要更新,且没有其它触发的渲染更新\n else if(clone.length > setStateList.length) {\n this.refresh();\n }\n // 避免重复刷新,在frame每帧执行中,比如图片进行了异步刷新,动画的hook就可以省略再刷新一次\n let r = this.__hookTask;\n if(r) {\n let hookTask = frame.__hookTask;\n let i = hookTask.indexOf(r);\n if(i > -1) {\n hookTask.splice(i, 1);\n }\n }\n // 触发didUpdate\n updater.did();\n }\n },\n after: diff => {\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n }\n if(task.indexOf(cb) === -1) {\n task.push(cb);\n }\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n if(task[i] === cb) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n frame.offFrame(this.__rTask);\n }\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param width\n * @param height\n * @private\n */\n __checkRoot(width, height) {\n let { currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle.display) === -1) {\n computedStyle.display = currentStyle.display = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle.positoin === 'absolute') {\n computedStyle.position = currentStyle.positoin = 'static';\n }\n // 根节点满宽高\n currentStyle.width = {\n value: width,\n unit: PX,\n };\n currentStyle.height = {\n value: height,\n unit: PX,\n };\n computedStyle.width = width;\n computedStyle.height = height;\n // 继承值变默认,提前处理以便子节点根据parent计算\n css.computeMeasure(this, true);\n }\n\n __addUpdate(o) {\n this.__updateList.push(o);\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let { __updateList: updateList } = this;\n let hasUpdate;\n // 先按node合并所有样式的更新,一个node可能有多次更新调用,每个node临时生成一个更新id和更新style合集\n let totalList = [];\n let totalHash = {};\n let uniqueUpdateId = 0;\n updateList.forEach(item => {\n let { node, style, origin, overwrite, focus, img, measure } = item;\n // 事件队列和setState等原因,可能node已经销毁\n if(node.isDestroyed) {\n return;\n }\n if(!node.hasOwnProperty('__uniqueUpdateId')) {\n node.__uniqueUpdateId = uniqueUpdateId;\n totalHash[uniqueUpdateId++] = {\n node,\n style: {},\n focus,\n img,\n measure,\n };\n totalList.push(node);\n }\n // updateStyle()这样的调用还要计算normalize\n if(origin && style) {\n style = css.normalize(style);\n }\n // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复\n if(overwrite && style) {\n Object.assign(node.__style, style);\n }\n if(style) {\n Object.assign(totalHash[node.__uniqueUpdateId].style, style);\n }\n });\n // 此时做root检查,防止root出现继承等无效样式\n this.__checkRoot(width, height);\n // 合并完后按node计算更新的结果,无变化/reflow/repaint等级\n let measureList = [];\n let reflowList = [];\n for(let i = 0, len = totalList.length; i < len; i++) {\n let node = totalList[i];\n let { tagName, __uniqueUpdateId, currentStyle, currentProps, __cacheStyle = {}, __cacheProps = {} } = node;\n let lv = level.NONE;\n let p;\n let { style, focus, img, measure } = totalHash[__uniqueUpdateId];\n if(img) {\n lv |= level.REPAINT;\n }\n let hasMeasure = measure;\n let hasZ;\n for(let k in style) {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n // 只有geom的props和style2种可能\n if(change.isGeom(tagName, k)) {\n if(!css.equalStyle(k, v, currentProps[k], node)) {\n hasUpdate = true;\n this.renderMode === mode.SVG && node.__cancelCacheSvg();\n p = p || {};\n p[k] = style[k];\n lv |= level.REPAINT;\n __cacheProps[k] = undefined;\n }\n }\n else {\n if(k === 'zIndex') {\n hasZ = true;\n }\n // 需和现在不等,且不是pointerEvents这种无关的\n if(!css.equalStyle(k, v, currentStyle[k], node)) {\n this.renderMode === mode.SVG && node.__cancelCacheSvg();\n // pointerEvents这种无关的只需更新\n if(change.isIgnore(k)) {\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n else {\n hasUpdate = true;\n // 只粗略区分出none/repaint/reflow,repaint细化等级在后续,reflow在checkReflow()\n lv |= level.getLevel(k);\n if(change.isMeasure(k)) {\n hasMeasure = true;\n }\n // repaint置空,如果reflow会重新生成空的\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n }\n }\n }\n }\n if(p) {\n Object.assign(currentProps, p);\n }\n if(style) {\n Object.assign(currentStyle, style);\n }\n if(focus !== undefined) {\n hasUpdate = true;\n lv = level.focus;\n }\n // 无需任何改变处理的去除记录,如pointerEvents\n if(lv === level.NONE) {\n delete node.__uniqueUpdateId;\n totalList.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // reflow/repaint/measure相关的记录下来\n let isRepaint = level.isRepaint(lv);\n if(isRepaint) {\n // zIndex变化需清空svg缓存\n if(hasZ && renderMode === mode.SVG) {\n node.__cancelCacheSvg(true);\n }\n else {\n node.__cancelCacheSvg();\n }\n // TODO: repaint级别在node有缓存对象时赋予它,没有说明无缓存无作用\n // if(node.__cache) {\n // node.__cache.lv = level.getDetailLevel(style, lv);\n // }\n }\n // reflow在root的refresh中做\n else {\n reflowList.push({\n node,\n style,\n img,\n });\n // measure需要提前先处理\n if(hasMeasure) {\n measureList.push(node);\n }\n }\n }\n this.__updateList = [];\n // 没有更新的内容返回true\n if(!hasUpdate) {\n totalList.forEach(node => {\n delete node.__uniqueUpdateId;\n });\n return true;\n }\n this.__reflowList = reflowList;\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __uniqueUpdateId, parent } = node;\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n let last = node;\n // 检查measure的属性是否是inherit\n let isInherit = change.isMeasureInherit(totalHash[__uniqueUpdateId].style);\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent) {\n let { __uniqueUpdateId, currentStyle } = parent;\n let style = totalHash[__uniqueUpdateId];\n let isInherit;\n if(parent.hasOwnProperty('__uniqueUpdateId')) {\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n temp.forEach(k => {\n currentStyle[k] = style[k];\n // 已经赋值过的删除避免重复\n delete style[k];\n });\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承,一定不会有root,因为root已前置checkRoot()\n parent = findParentNotComponent(parent, this);\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.hasOwnProperty('__uniqueUpdateId')) {\n measureHash[target.__uniqueUpdateId] = true;\n }\n });\n });\n totalList.forEach(node => {\n delete node.__uniqueUpdateId;\n });\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响后面兄弟和父resize\n * 当flex变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响所有递归子节点和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 一般需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n let root = this;\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n\n // 单独提出共用检测影响的函数,非absolute和relative的offset情况从节点本身开始向上分析影响\n function checkInfluence(node) {\n // 自身尺寸固定且无变化,无需向上查找\n if(isFixedSize(node)) {\n return;\n }\n // cp强制刷新\n if(node instanceof Component) {\n return;\n }\n let target = node;\n // inline新老都影响,节点变为最近的父非inline\n if(node.currentStyle.display === 'inline' || node.computedStyle.display === 'inline') {\n let parent = findParentNotComponent(node, root);\n do {\n target = parent;\n // 父到root提前跳出\n if(parent === root) {\n return true;\n }\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 遇到absolute跳出,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 父固定宽度跳出直接父进行LAYOUT即可\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 继续向上\n parent = findParentNotComponent(parent, root);\n }\n while(parent && (parent.currentStyle.display === 'inline' || parent.computedStyle.display === 'inline'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果原本是inline则是其非inline父\n let parent = target.parent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 检查flex,如果父是flex,向上查找flex顶点视作其更改\n if(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex')) {\n do {\n target = parent;\n if(parent === root) {\n return true;\n }\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n parent = findParentNotComponent(parent, root);\n }\n while(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果父原本是flex则是其最上flex父\n parent = target.parent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 向上查找了并且没提前跳出的,父重新布局\n if(target !== node) {\n setLAYOUT(target, reflowHash);\n }\n }\n\n // TODO text变parent dom\n\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let { node, style, img } = reflowList[i];\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n let { currentStyle, computedStyle } = node;\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = {\n node,\n lv: OFFSET,\n };\n }\n let o = reflowHash[node.__uniqueReflowId];\n // absolute无变化,只影响自己\n if(currentStyle.position === 'absolute' && computedStyle.position === 'absolute') {\n o.lv = LAYOUT;\n }\n // absolute和非absolute互换\n else if(currentStyle.position !== computedStyle.position) {\n o.lv = LAYOUT;\n if(checkInfluence(node)) {\n hasRoot = true;\n break;\n }\n }\n // 所有其它变化\n else {\n let keys = Object.keys(style);\n let onlyXY = true;\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n if(k !== 'left' && k !== 'top' && k !== 'right' && k !== 'bottom') {\n onlyXY = false;\n break;\n }\n }\n // relative只有x/y变化时特殊只进行OFFSET,非relative的忽视掉这个无用影响\n if(onlyXY && !img) {\n if(computedStyle.position === 'relative') {\n o.lv |= OFFSET;\n }\n }\n // 剩余的其它变化\n else {\n o.lv = LAYOUT;\n if(checkInfluence(node)) {\n hasRoot = true;\n break;\n }\n }\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n return [reflowList, [{\n node: this,\n lv: LAYOUT,\n }]];\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n let uniqueList = [];\n this.deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n delete node.__uniqueReflowId; // 清除掉\n if(o.lv >= LAYOUT) {\n options.uniqueList.push(o);\n }\n else {\n // OFFSET的话先递归看子节点,本身改变放在最后\n let uniqueList = [];\n node.deepScan(function(child, uniqueList) {}, { uniqueList });\n uniqueList.forEach(item => {\n options.uniqueList.push(item);\n });\n options.uniqueList.push(o);\n\n }\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n // 按顺序执行列表即可,上层LAYOUT先执行停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n uniqueList.forEach(item => {\n let { node, lv } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n if(lv >= LAYOUT) {\n let isLastAbs = node.computedStyle.position === 'absolute';\n let isNowAbs = node.currentStyle.position === 'absolute';\n let parent = findParentNotComponent(node, root);\n let { layoutData: { x, y, w, h }, width, ox, oy, computedStyle } = parent;\n let ref;\n if(ref = node.prev) {\n y = ref.y;\n y += ref.outerHeight;\n }\n else {\n y = parent.y;\n y += computedStyle.marginTop + computedStyle.borderTopWidth + computedStyle.paddingTop;\n }\n x += computedStyle.marginLeft + computedStyle.borderLeftWidth + computedStyle.paddingLeft;\n let { outerWidth, outerHeight } = node;\n if(isNowAbs) {\n // 找到最上层容器\n let container = parent;\n while(container) {\n if(isRelativeOrAbsolute) {\n break;\n }\n container = container.parent; // TODO\n }\n if(!container) {\n container = root;\n }\n parent.__layoutAbs(container, null, node);\n // 一直abs无需偏移后面兄弟\n if(isLastAbs) {\n return;\n }\n }\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n }\n // 记录重新布局引发的差值w/h\n let { outerWidth: ow, outerHeight: oh } = node;\n let dx = ow - outerWidth;\n let dy = oh - outerHeight;\n // 如果parent是relative,需再次累加ox/oy,无需向上递归,因为parent已经包含了\n if(computedStyle.position === 'relative') {\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n }\n // 如果有差值,递归向上所有parent需要扩充,直到absolute的中止\n if(dx || dy) {\n do {\n let { currentStyle } = parent;\n if(dx) {\n let need;\n // width在block不需要,parent一定不会是flex/inline\n if(currentStyle.positoin === 'absolute') {\n if(currentStyle.width.unit === AUTO\n && (currentStyle.left.unit === AUTO || currentStyle.right.unit === AUTO)) {\n need = true;\n }\n }\n }\n if(dy) {\n let need;\n if(currentStyle.positoin === 'absolute') {\n if(currentStyle.height.unit === AUTO\n && (currentStyle.top.unit === AUTO || currentStyle.bottom.unit === AUTO)) {\n need = true;\n }\n }\n // height则需要\n else if(currentStyle.height.unit === AUTO) {\n need = true;\n }\n if(need) {\n parent.__resizeY(dy);\n parent.__cancelCache(true);\n }\n }\n if(currentStyle.positoin === 'absolute') {\n break;\n }\n parent = findParentNotComponent(parent);\n }\n while(parent);\n }\n if(dy) {\n // 后面兄弟如果非absolute或非LAYOUT则offsetY\n let next = node.next;\n while(next) {\n if(next.currentStyle.position !== 'absolute'\n || !next.hasOwnProperty('____uniqueReflowId')\n || reflowHash[next.____uniqueReflowId].lv < LAYOUT) {\n next.__offsetY(dy, true);\n next.layoutData.y += dy;\n next.__cancelCache(true);\n }\n next = next.next;\n }\n }\n }\n // OFFSET操作的节点都是relative,要考虑auto变化\n else {\n let {\n currentStyle: { top, right, bottom, left }, currentStyle,\n computedStyle: { top: t, right: r, bottom: b, left: l }, computedStyle,\n } = node;\n let parent;\n if(node === this) {\n parent = node;\n }\n else {\n parent = findParentNotComponent(node, root);\n }\n let newY = 0;\n if(top.unit !== AUTO) {\n newY = calRelative(currentStyle, 'top', top, parent);\n computedStyle.top = newY;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n newY = -calRelative(currentStyle, 'bottom', bottom, parent);\n computedStyle.bottom = -newY;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n let oldY = 0;\n if(t !== 'auto') {\n oldY = t;\n }\n else if(b !== 'auto') {\n oldY = -b;\n }\n if(newY !== oldY) {\n node.__offsetY(newY - oldY);\n }\n let newX = 0;\n if(left.unit !== AUTO) {\n newX = calRelative(currentStyle, 'left', left, parent);\n computedStyle.left = newX;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n newX = -calRelative(currentStyle, 'right', right, parent);\n computedStyle.right = -newX;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n let oldX = 0;\n if(l !== 'auto') {\n oldX = l;\n }\n else if(r !== 'auto') {\n oldX = -r;\n }\n if(newX !== oldX) {\n node.__offsetX(newX - oldX);\n }\n }\n });\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n return [reflowList, uniqueList];\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n __frameHook() {\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n let r = this.__hookTask = this.__hookTask || (() => {\n this.refresh();\n });\n if(frame.__hookTask.indexOf(r) === -1) {\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n\n get dom() {\n return this.__dom;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get offScreen() {\n return this.__offScreen;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get task() {\n return this.__task;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n}\n\nexport default Root;\n","import Xom from '../node/Xom';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport mode from '../node/mode';\nimport util from '../util/util';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { int2rgba, isNil } = util;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__isMask = !!this.props.mask;\n this.__isClip = !!this.props.clip;\n let { style, isMask, isClip } = this;\n if(isMask || isClip) {\n style.visibility = 'visible';\n style.background = null;\n style.border = null;\n style.strokeWidth = 0;\n style.stroke = null;\n if(isClip) {\n style.fill = '#FFF';\n style.opacity = 1;\n }\n }\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n this.__cacheProps = {};\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n return w;\n }\n\n __calAutoBasis(isDirectionRow) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit !== AUTO) {\n b = max += main.value;\n }\n // border也得计算在内\n if(isDirectionRow) {\n let w = borderRightWidth + borderLeftWidth;\n b += w;\n max += w;\n min += w;\n }\n else {\n let h = borderTopWidth + borderBottomWidth;\n b += h;\n max += h;\n min += h;\n }\n return { b, min, max };\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__marginAuto(this.currentStyle, data);\n this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n this.__width = fixedWidth ? w : x - data.x;\n this.__height = fixedHeight ? h : y - data.y;\n this.__cacheProps = {};\n }\n\n __preRender(renderMode, ctx, defs) {\n let { sx: x, sy: y, width, height, __cacheStyle, currentStyle, computedStyle } = this;\n let {\n borderTopWidth,\n borderLeftWidth,\n display,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n visibility,\n } = computedStyle;\n let originX = x + borderLeftWidth + marginLeft + paddingLeft;\n let originY = y + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n let iw = width + paddingLeft + paddingRight;\n let ih = height + paddingTop + paddingBottom;\n // 先根据cache计算需要重新计算的computedStyle\n if(__cacheStyle.stroke === undefined) {\n let stroke = currentStyle.stroke;\n computedStyle.stroke = stroke;\n if(stroke && (stroke.k === 'linear' || stroke.k === 'radial')) {\n __cacheStyle.stroke = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, stroke);\n }\n else {\n __cacheStyle.stroke = int2rgba(currentStyle.stroke);\n }\n }\n if(__cacheStyle.fill === undefined) {\n let fill = currentStyle.fill;\n computedStyle.fill = fill;\n if(fill && (fill.k === 'linear' || fill.k === 'radial')) {\n __cacheStyle.fill = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, fill);\n }\n else {\n __cacheStyle.fill = int2rgba(currentStyle.fill);\n }\n }\n if(__cacheStyle.strokeWidth === undefined) {\n __cacheStyle.strokeWidth = true;\n let strokeWidth = currentStyle.strokeWidth;\n if(strokeWidth.unit === PX) {\n computedStyle.strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n computedStyle.strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n computedStyle.strokeWidth = 0;\n }\n }\n if(__cacheStyle.strokeWidth === undefined) {\n __cacheStyle.strokeWidth = true;\n let strokeWidth = currentStyle.strokeWidth;\n if(strokeWidth.unit === PX) {\n computedStyle.strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n computedStyle.strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n computedStyle.strokeWidth = 0;\n }\n }\n if(__cacheStyle.strokeDasharray === undefined) {\n __cacheStyle.strokeDasharray = true;\n computedStyle.strokeDasharray = currentStyle.strokeDasharray;\n __cacheStyle.strokeDasharrayStr = util.joinArr(currentStyle.strokeDasharray, ',');\n }\n // 直接赋值的\n [\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit'\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let {\n fill,\n stroke,\n strokeDasharrayStr,\n } = __cacheStyle;\n let {\n strokeWidth,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n strokeDasharray,\n } = computedStyle;\n if(renderMode === mode.CANVAS) {\n if(ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n if(ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n if(!util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n return {\n x,\n y,\n originX,\n originY,\n cx,\n cy,\n display,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n visibility,\n };\n }\n\n render(renderMode, ctx, defs) {\n super.render(renderMode, ctx, defs);\n if(renderMode === mode.SVG) {\n if(this.virtualDom.cache) {\n return {\n cache: true,\n };\n }\n this.virtualDom.type = 'geom';\n }\n let { isDestroyed, computedStyle: { display } } = this;\n if(isDestroyed || display === 'none') {\n return {\n isDestroyed,\n display,\n };\n }\n return this.__preRender(renderMode, ctx, defs);\n }\n\n __renderAsMask(renderMode, ctx, defs, isClip) {\n // mask渲染在canvas等被遮罩层调用,svg生成maskId\n if(renderMode === mode.SVG) {\n // 强制不缓存,防止引用mask的matrix变化不生效\n this.__cancelCacheSvg();\n this.render(renderMode, ctx, defs);\n let vd = this.virtualDom;\n if(isClip) {\n vd.isClip = true;\n }\n else {\n vd.isMask = true;\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n __cancelCache() {\n super.__cancelCache();\n this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n get baseLine() {\n return this.__height;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static getRegister(name) {\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return REGISTER.hasOwnProperty(name);\n }\n}\n\nexport default Geom;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length === 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length === 2) {\n num++;\n }\n if(controlB.length === 2) {\n num += 2;\n }\n return num;\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n }\n else {\n this.__x1 = this.__y1 = 0;\n this.__x2 = this.__y2 = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n display,\n visibility,\n originX,\n originY,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, x1, y1, x2, y2, controlA, controlB, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.x1)) {\n rebuild = true;\n __cacheProps.x1 = reBuild(x1, originX, width, isMulti);\n }\n if(isNil(__cacheProps.x2)) {\n rebuild = true;\n __cacheProps.x2 = reBuild(x2, originX, width, isMulti);\n }\n if(isNil(__cacheProps.y1)) {\n rebuild = true;\n __cacheProps.y1 = reBuild(y1, originY, height, isMulti);\n }\n if(isNil(__cacheProps.y2)) {\n rebuild = true;\n __cacheProps.y2 = reBuild(y2, originY, height, isMulti);\n }\n if(isNil(__cacheProps.controlA)) {\n rebuild = true;\n __cacheProps.controlA = reBuildC(controlA, originX, originY, width, height, isMulti);\n }\n if(isNil(__cacheProps.controlB)) {\n rebuild = true;\n __cacheProps.controlB = reBuildC(controlB, originX, originY, width, height, isMulti);\n }\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let curve = curveNum(ca, cb);\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n d = painter.svgLine(__cacheProps.x1, __cacheProps.y1, __cacheProps.x2, __cacheProps.y2,\n __cacheProps.controlA, __cacheProps.controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS) {\n if(strokeWidth > 0) {\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let curve = curveNum(ca, cb);\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n painter.canvasLine(ctx, __cacheProps.x1, __cacheProps.y1, __cacheProps.x2, __cacheProps.y2,\n __cacheProps.controlA, __cacheProps.controlB, curve);\n }\n ctx.stroke();\n ctx.closePath();\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get x1() {\n return this.getProps('x1');\n }\n get y1() {\n return this.getProps('y1');\n }\n get x2() {\n return this.getProps('x2');\n }\n get y2() {\n return this.getProps('y2');\n }\n get controlA() {\n return this.getProps('controlA');\n }\n get controlB() {\n return this.getProps('controlB');\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\n\nlet { isNil } = util;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, points, controls, __cacheProps, isMulti } = this;\n let rebuild = true;\n if(isNil(__cacheProps.points)) {\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n let pts = __cacheProps.points;\n let cls = __cacheProps.controls;\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n if(isMulti) {\n let list = pts.filter(item => Array.isArray(item)).map((item, i) => {\n let cl = cls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n list.forEach(item => d += painter.svgPolygon(item));\n __cacheProps.d = d;\n }\n }\n else {\n let list = pts.filter(item => Array.isArray(item)).map((point, i) => {\n if(i) {\n return concatPointAndControl(point, cls[i - 1]);\n }\n return point;\n });\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n let list = __cacheProps.list;\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get points() {\n return this.getProps('points');\n }\n get controls() {\n return this.getProps('controls');\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction getCoordsByDegree(x, y, r, d) {\n d = d % 360;\n if(d >= 0 && d < 90) {\n return [\n x + Math.sin(d * Math.PI / 180) * r,\n y - Math.cos(d * Math.PI / 180) * r\n ];\n }\n else if(d >= 90 && d < 180) {\n return [\n x + Math.cos((d - 90) * Math.PI / 180) * r,\n y + Math.sin((d - 90) * Math.PI / 180) * r,\n ];\n }\n else if(d >= 180 && d < 270) {\n return [\n x - Math.cos((270 - d) * Math.PI / 180) * r,\n y + Math.sin((270 - d) * Math.PI / 180) * r,\n ];\n }\n else {\n return [\n x - Math.sin((360 - d) * Math.PI / 180) * r,\n y - Math.cos((360 - d) * Math.PI / 180) * r,\n ];\n }\n}\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin)) {\n rebuild = true;\n __cacheProps.begin = begin;\n }\n if(isNil(__cacheProps.end)) {\n rebuild = true;\n __cacheProps.end = end;\n }\n if(isNil(__cacheProps.r)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n if(isNil(__cacheProps.edge)) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure)) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n // begin/end/r/edge/closure有变化就重建\n if(rebuild) {\n let { begin, end, r, closure } = __cacheProps;\n if(isMulti) {\n __cacheProps.x1 = [];\n __cacheProps.x2 = [];\n __cacheProps.y1 = [];\n __cacheProps.y2 = [];\n __cacheProps.large = [];\n __cacheProps.d = [];\n begin.forEach((begin, i) => {\n let r = isNil(r) ? width * 0.5 : r;\n let [x1, y1] = getCoordsByDegree(cx, cy, r, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r, end[i] || 0);\n let large = ((end[i] || 0) - begin) > 180 ? 1 : 0;\n __cacheProps.x1.push(x1);\n __cacheProps.x2.push(x2);\n __cacheProps.y1.push(y1);\n __cacheProps.y2.push(y2);\n __cacheProps.large.push(large);\n if(renderMode === mode.SVG) {\n __cacheProps.d.push(painter.svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge[i] || 0, closure[i]));\n }\n });\n }\n else {\n let [x1, y1] = getCoordsByDegree(cx, cy, r, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r, end);\n let large = (end - begin) > 180 ? 1 : 0;\n __cacheProps.x1 = x1;\n __cacheProps.x2 = x2;\n __cacheProps.y1 = y1;\n __cacheProps.y2 = y2;\n __cacheProps.large = large;\n if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let { begin, end, r, x1, y1, x2, y2, edge, large, closure } = __cacheProps;\n ctx.beginPath();\n if(isMulti) {\n begin.forEach((begin, i) => painter.canvasSector(ctx, cx, cy, r[i], x1[i], y1[i], x2[i], y2[i],\n strokeWidth, begin[i], end[i], large[i], edge[i], closure[i]));\n }\n else {\n painter.canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure);\n }\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n __cacheProps.d.map((item, i) => this.__genSector(__cacheProps.edge[i], item, fill, stroke, strokeWidth,\n strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit));\n }\n else {\n this.__genSector(__cacheProps.edge, __cacheProps.d, fill, stroke, strokeWidth,\n strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n }\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n get end() {\n return this.getProps('end');\n }\n get r() {\n return this.getProps('r');\n }\n get edge() {\n return this.getProps('edge');\n }\n get closure() {\n return this.getProps('closure');\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\nimport util from \"../util/util\";\n\nlet { isNil } = util;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n // rx/ry有变化需重建顶点\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n let list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n list.forEach(item => d += painter.svgPolygon(item));\n __cacheProps.d = d;\n }\n }\n else {\n let list = genVertex(originX, originY, width, height, rx, ry);\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let list = __cacheProps.list;\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get rx() {\n return this.getProps('rx');\n }\n get ry() {\n return this.getProps('ry');\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r)) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n let list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = '';\n list.forEach(item => __cacheProps.d += painter.svgPolygon(item));\n }\n }\n else {\n __cacheProps.r = r * width * 0.5;\n let list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let list = __cacheProps.list;\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get r() {\n return this.getProps('r');\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cache,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden' || cache) {\n return;\n }\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n // rx/ry有一个变了重新计算顶点\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n let list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = '';\n list.forEach(item => __cacheProps.d += painter.svgPolygon(item));\n }\n }\n else {\n let list = geom.ellipsePoints(cx, cy, rx, ry);\n if(renderMode === mode.CANVAS) {\n __cacheProps.list = list;\n }\n else if(renderMode === mode.SVG) {\n __cacheProps.d = painter.svgPolygon(list);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n let list = __cacheProps.list;\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item));\n }\n else {\n painter.canvasPolygon(ctx, list);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n\n get rx() {\n return this.getProps('rx');\n }\n get ry() {\n return this.getProps('ry');\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n};\n\nlet abbrCssProperty = {\n os: 'offset',\n e: 'easing',\n ft: 'filter',\n bd: 'boxShadow',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET).forEach(item => {\n let k = item.k;\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\n\nconst { TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(target, vars) {\n if(target && vars) {\n Object.keys(target).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = target[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n console.error('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 只需将可能存在的children在遍历link一遍即可,如果children里有递归,前面因为出现过已经link过了\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let { id, children } = item;\n if(Array.isArray(children)) {\n children.forEach(child => {\n // 排除原始类型文本\n if(!isPrimitive(child)) {\n let { libraryId } = child;\n // ide中库文件的child来自于库一定有libraryId,但是为了编程特殊需求,放开允许存入自定义数据\n if(isNil(libraryId)) {\n return;\n }\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,属性和子图层来自库\n if(libraryItem) {\n linkChild(child, libraryItem);\n }\n else {\n throw new Error('Link library item miss libraryId: ' + libraryId);\n }\n }\n });\n }\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, vars, hash = {}) {\n if(isPrimitive(json) || json instanceof Node) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, vars, hash);\n });\n }\n let { library, libraryId } = json;\n // 有library说明是个mc节点,不会有init/animate和children链接,是个正常节点\n if(Array.isArray(library)) {\n hash = {};\n // 强制要求library的文件是排好顺序的,即元件和被引用类型在前面,引用的在后面,\n // 另外没有循环引用,没有递归library,先遍历设置引用,再递归进行连接\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 删除以免二次解析,有library一定没libraryId\n json.library = null;\n json.libraryId = null;\n }\n // ide中库文件的child一定有libraryId,有library时一定不会有libraryId\n else if(!isNil(libraryId) && hash) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n }\n let { tagName, props = {}, children = [], animate = [], __animateRecords } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, vars);\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else {\n vd = karas.createVd(tagName, props, children.map((item, i) => {\n if(item && [TYPE_PL, TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, vars, hash);\n }));\n }\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n }\n let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport Controller from '../animate/Controller';\n\nexport default {\n parse(karas, json, dom, options = {}) {\n json = util.clone(json);\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options.vars);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__auto = ac.__auto.concat(animateRecords);\n ac.__playAuto();\n }\n else {\n ac.__records = ac.__records.concat(animateRecords);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n abbr,\n};\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\n\nexport default {\n css,\n reset,\n unit,\n font,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","export default {\n pointerEvents: true,\n};\n","import invalid from './invalid';\nimport level from './level';\nimport change from './change';\n\nexport default {\n invalid,\n level,\n change,\n};\n","import Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './geom/Geom';\nimport Line from './geom/Line';\nimport Polyline from './geom/Polyline';\nimport Polygon from './geom/Polygon';\nimport Sector from './geom/Sector';\nimport Rect from './geom/Rect';\nimport Circle from './geom/Circle';\nimport Ellipse from './geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n mode,\n Component,\n Geom,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\nupdater.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\n\nexport default karas;\n"],"names":["Node","__x","__y","__ox","__oy","__width","__height","__baseLine","__prev","__next","__parent","__root","__host","diff","isLayout","__isDestroyed","x","ox","y","oy","__virtualDom","CANVAS","SVG","canvasPolygon","ctx","list","length","n","moveTo","i","len","item","Array","isArray","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","s","canvasLine","x1","y1","x2","y2","controlA","controlB","num","svgLine","OFFSET","Math","PI","canvasSector","cx","cy","r","strokeWidth","begin","end","large","edge","closure","arc","stroke","svgSector","d","d2","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","identity","multiply","a","b","isPreIdA","isPreIdB","isSubIdA","isSubIdB","slice","c","calPoint","point","m","e","f","int2convolution","v","floor","sqrt","inverse","ar","br","cr","dr","er","fr","H","vectorProduct","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","max","min","angleBySide","theta","pow","acos","pointsDistance","triangleIncentre","x3","y3","ellipsePoints","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","matrix","computedStyle","width","height","transformOrigin","mx","calPercentInNode","ds","atan","d1","deg","Infinity","dt","cos","sin","d2r","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","bx","by","ax","ay","hx","hy","t","q","bboxBezier","arguments","h","calDeg","dx","dy","abs","rotate","pointIndex","points","index","cross","pointByIndex","res","j","push","exchangeOrder","source","target","sx1","sy1","sx2","sy2","sx3","sy3","tx1","ty1","tx2","ty2","tx3","ty3","isOverflow","cross1","cross2","transform","overflow","ls","geom","lt","alpha","ls2","lt2","ax2","ay2","ax3","ay3","ab","ac","bc","AB","AC","BC","A","tan","tar","TYPE_PL","_","TYPE_VD","TYPE_GM","TYPE_CP","toString","isType","type","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","isNil","undefined","joinSourceArray","arr","stringify","encodeHtml","prop","replace","joinVirtualDom","vd","defs","forEach","joinDef","bbClip","bb","joinVd","conClip","children","isMask","isClip","props","tagName","content","opacity","mask","clip","filter","def","uuid","joinItem","rgba2int","color","charAt","parseInt","match","parseFloat","int2rgba","joinArr","arr2hash","hash","Object","keys","k","hash2arr","clone","$$type","util","Date","equalArr","ai","bi","isArrayA","isArrayB","equal","hasOwnProperty","getTime","extend","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__target","assigning","assignCurrentStyle","isPrimitive","isAuto","unit","math","calSingle","calMatrix","ow","oh","normalize","calMatrixByOrigin","t2","calMatrixWithOrigin","pointInQuadrilateral","x4","y4","normalizeSingle","value","calOrigin","w","tfo","position","gradient","img","getLinearDeg","exec","getRadialPosition","data","test","top","left","center","right","bottom","getColorStop","p","start","per","prev","allBefore","allAfter","first","last","getCsLimit","next","c1","c2","getCsStartLimit","getCsEndLimit","calLinearCoords","calRadialRadius","shape","size","iw","ih","xl","yl","p1","p2","r1","g1","b1","a1","r2","g2","b2","a2","l1","l2","g","parseGradient","reg","o","toLowerCase","indexOf","z","map","getLinear","stop","getRadial","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","isLast","main1","main2","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","oyl","rx2","ry2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","concat","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btw","brw","bbw","blw","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","arial","lhr","car","blr","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","fontFamily","fontStyle","fontWeight","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","justifyContent","alignItems","textAlign","visibility","zIndex","translateX","translateY","scaleX","scaleY","skewX","skewY","rotateZ","boxShadow","pointerEvents","GEOM","fill","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","grow","shrink","basis","parseMarginPadding","key","temp","parseOneBorder","margin","padding","border","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","background","backgroundPosition","flex","translate","scale","skew","toFull","gd","repeat","bgc","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","KEY_EXPAND","EXPAND_HASH","IGNORE","REPAINT","MEASURE","isIgnore","isRepaint","isGeom","isMeasure","addGeom","ks","reset","MEASURE_KEY_SET","isMeasureInherit","measureInheritList","DEFAULT_FONT_SIZE","calUnit","compatibleTransform","abbr","console","error","arr1","arr2","isNaN","blur","computeMeasure","isHost","currentStyle","parent","parentComputedStyle","change","computeReflow","isRoot","calNormalLineHeight","setFontStyle","getBaseLine","normal","font","calRelativePercent","calRelative","isWidth","calAbsolute","equalStyle","oa","ob","av","bv","isMulti","isRelativeOrAbsolute","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","VERTEX","FRAGMENT","initShaders","gl","vshader","fshader","program","createProgram","useProgram","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","initVertexBuffers","vertices","Float32Array","vertexBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","FSIZE","BYTES_PER_ELEMENT","aPosition","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","aTexCoord","projectionMatrix","getUniformLocation","uniformMatrix3fv","initLocation","uSampler","uOffset","uClamp","createAndSetupTexture","texture","createTexture","bindTexture","TEXTURE_2D","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","KawaseBlurFilter","webgl","quality","pixelStorei","UNPACK_FLIP_Y_WEBGL","vertexLocations","textureLocations","_pixelSize","pixelSize","_kernels","_blur","textures","framebuffers","texImage2D","UNSIGNED_BYTE","fbo","createFramebuffer","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","image","uOffsetArray","clear","uniform2f","viewport","uniform4f","drawArrays","TRIANGLE_STRIP","initBuffers","uniform1i","originalImageTexture","canvas","uvX","uvY","offset","_quality","draw","clearRect","drawImage","kernels","step","clearColor","COLOR_BUFFER_BIT","apply","round","_generateKernels","gaussBlur","LineBox","__content","renderMode","cacheStyle","css","mode","fillText","Text","__lineBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","wait","MEASURE_TEXT","cache","CHAR_WIDTH_CACHE","sum","needMeasure","char","mw","charWidth","measureText","isVirtual","isDestroyed","lineBoxes","count","maxW","lineBox","__offsetX","__offsetY","textWidth","__layout","fillStyle","render","virtualDom","baseLine","__cacheStyle","prototype","__renderByMask","SPF","WEBGL","cacheCanvas","document","createElement","setAttribute","getContext","cacheWebgl","IMG","INIT","LOADING","LOADED","inject","html","chars","inline","div","body","appendChild","innerHTML","cns","childNodes","window","getComputedStyle","text","__measureCb","removeChild","measureImg","url","state","task","Image","onload","success","onerror","substr","host","location","hostname","crossOrigin","src","warn","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","getCacheCanvas","getCacheWebgl","isDom","Element","getElementsByTagName","Event","__eHash","handle","self","on","off","__karasEventCb","once","emit","event","fns","fn","traversal","before","after","isPause","Frame","__hookTask","__task","__now","__init","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","B","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","Error","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","unify","frames","currentProps","inherit","outerWidth","outerHeight","tf","genBeforeRefresh","frameStyle","animation","root","__addUpdate","__style","__assigning","__frameHook","framing","duration","es","time","transition","calDiff","pm","nm","pi","ni","pv","nv","innerWidth","eq","pp","np","v2","len2","pv2","nv2","v3","len3","pv3","nv3","calFrame","ts","binarySearch","frame","middle","getEasing","ea","timingFunction","steps","stepsD","percent","ceil","calIntermediateStyle","st","o2","n2","st2","gotoOverload","options","Animation","__id","__list","nl","__options","op","__duration","delay","endDelay","iterations","fps","playbackRate","__easing","playCount","spfLimit","__frames","__framesR","__startTime","currentTime","__nextTime","__fpsTime","__playState","current","unshift","copy","__keys","__originStyle","framesR","reverse","__clean","isFinish","__cancelTask","restore","__currentTime","__playCount","__stayEnd","__currentProps","__currentStyle","__cancelCacheSvg","__fin","__begin","__end","__isDelay","__finish","__inFps","__enterFrame","FINISH","__frameCb","isDelay","FRAME","__firstPlay","PLAY","__playCb","playState","firstEnter","stayEnd","stayBegin","__stayBegin","enterFrame","__calDiffTime","currentFrames","alternate","isEven","isLastFrame","isLastCount","inEndDelay","__nextBegin","BEGIN","END","pending","PAUSE","play","addRefreshTask","CANCEL","__goto","isFrame","excludeDelay","finish","spf","animateController","add","remove","backwards","both","forwards","sync","removeControl","nextFrame","__delay","__endDelay","__fps","__iterations","__fill","__direction","__playbackRate","__spfLimit","ENUM","NONE","TRANSFORM","OPACITY","FILTER","TRANSFORM_OPACITY","TRANSFORM_FILTER","OPACITY_FILTER","TRANSFORM_OPACITY_FILTER","REFLOW","assign","getLevel","getDetailLevel","lv","gt","gte","lte","isReflow","painter","renderBorder","xom","beginPath","closePath","renderBgc","method","rect","borderRadiusKs","calBorderRadius","noRadius","half","calBackgroundSize","calBackgroundPosition","container","renderBoxShadow","spread","inset","box","save","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","empty","Xom","__tagName","__computedStyle","__listener","__refreshLevel","level","listener","__loadBgi","__mpWidth","mp","fromAbs","__layoutData","__mp","__layoutFlex","__layoutInline","__layoutBlock","__cacheSvg","__animateRecords","controller","autoPlay","__records","__auto","__playAuto","w2","h2","fixedWidth","fixedHeight","innerHeight","matrixCache","isScale","__matrix","loadBgi","delRefreshTask","focus","__gradient","__opacity","globalAlpha","renderMatrix","__svgMatrix","matrixEvent","__matrixEvent","setTransform","offScreen","bgX","bgY","needMask","xnl","xnr","ynt","ynb","needResize","hasMask","hasClip","globalCompositeOperation","isEmpty","sibling","mChildren","svgMatrix","ref","owner","__destroy","force","__stopPropagation","__stopImmediatePropagation","willResponseEvent","inThis","__touchstartTarget","vs","__getLg","__getRg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","os","hasChange","origin","overwrite","cancel","LineGroup","__calBaseLine","Dom","Img","Geom","Component","initRoot","cd","flattenJson","build","relation","initCp","json","klass","__children","getRegister","traverseJson","lastText","sr","shadowRoot","setUpdateFlag","cp","__hasUpdate","constructor","__ref","__state","__isMounted","__nextState","builder","__cd","__shadowRoot","componentDidMount","REFRESH","componentWillUnmount","__emitEvent","__computeMeasure","defineProperty","get","TAG_NAME","INLINE","BOLD","__lineGroups","block","none","tag","flowChildren","__tryLayInline","isDirectionRow","isRecursion","main","__calAutoBasis","min2","max2","__calMp","lineGroups","__preLayout","cw","lineGroup","fw","verticalAlign","horizonAlign","__marginAuto","growList","shrinkList","basisList","minList","growSum","shrinkSum","basisSum","maxSum","maxCross","child","between","around","log","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__layoutAbs","__renderAsMask","zIndexChildren","recursion","__cancelCache","deepScan","flow","needSort","lastIndex","__iIndex","__zIndex","sort","loadImg","__loadImg","originX","originY","pts","strokeStyle","lineWidth","__addGeom","Defs","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldSr","oldJson","diffSr","layoutData","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","multi","diffChildren","diffChild","removeCpFromOldTree","oc","nc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","firstChild","lastChild","obb","nbb","oClip","nClip","isText","svg","where","insertBefore","Controller","args","animate","init","__action","__set","getDom","dom","querySelector","renderProp","initEvent","addEventListener","__wrapEvent","__cb","isFixedWidthOrHeight","isFixedSize","findParentNotComponent","LAYOUT","isLAYOUT","__uniqueReflowId","setLAYOUT","addLAYOUT","Root","__dom","__mw","__mh","__sx","__sy","__updateList","__reflowList","__animateController","mix","__offScreen","getBoundingClientRect","touches","pageX","pageY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","toUpperCase","__genHtml","__uuid","__defs","getInstance","getPropertyValue","__ctx","__renderMode","refresh","destroy","isFirst","__checkRoot","__checkUpdate","__checkReflow","__clear","__vd","__rTask","setStateList","updater","measure","hookTask","positoin","hasUpdate","totalList","totalHash","uniqueUpdateId","__uniqueUpdateId","measureList","reflowList","__cacheProps","hasMeasure","hasZ","measureHash","isInherit","hasRoot","reflowHash","checkInfluence","onlyXY","uniqueList","isLastAbs","isNowAbs","__resizeY","____uniqueReflowId","l","newY","oldY","newX","oldX","REGISTER","__isMulti","__isMask","__isClip","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","__preRender","name","hasRegister","reBuild","base","reBuildC","curveNum","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","rebuild","curve","__propsStrokeStyle","getProps","concatPointAndControl","control","Polyline","__points","__controls","controls","isControl","__getPoints","cls","cl","Polygon","getCoordsByDegree","getR","dft","Sector","__r","__edge","__closure","__genSector","genVertex","rx","ry","Rect","__rx","__ry","Circle","Ellipse","fullCssProperty","abbrCssProperty","ft","bd","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","k2","fk","replaceVars","vars","join","linkLibrary","libraryId","libraryItem","linkChild","JSON","parse","karas","animateRecords","library","createGm","createVd","animationRecord","has","invalid","register","version","appendTo","createCp","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAMA;EACJ,kBAAc;EAAA;;EACZ,SAAKC,GAAL,GAAW,CAAX;EACA,SAAKC,GAAL,GAAW,CAAX;EACA,SAAKC,IAAL,GAAY,CAAZ,CAHY;;EAIZ,SAAKC,IAAL,GAAY,CAAZ;EACA,SAAKC,OAAL,GAAe,CAAf;EACA,SAAKC,QAAL,GAAgB,CAAhB;EACA,SAAKC,UAAL,GAAkB,CAAlB;EACA,SAAKC,MAAL,GAAc,IAAd;EACA,SAAKC,MAAL,GAAc,IAAd;EACA,SAAKC,QAAL,GAAgB,IAAhB;EACA,SAAKC,MAAL,GAAc,IAAd;EACA,SAAKC,MAAL,GAAc,IAAd;EACD;;;;gCAESC,MAAMC,UAAU;EACxB,UAAGA,QAAH,EAAa;EACX,aAAKb,GAAL,IAAYY,IAAZ;EACD,OAFD,MAGK;EACH,aAAKV,IAAL,IAAaU,IAAb;EACD;EACF;;;gCAESA,MAAMC,UAAU;EACxB,UAAGA,QAAH,EAAa;EACX,aAAKZ,GAAL,IAAYW,IAAZ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APA;EAzEU,CAAZ;EA4EAlM,OAAO,CAAClD,GAAR,CAAY;EACV1D,EAAAA,GAAG,EAAHA,GADU;EAEVkF,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;EAOAmO,OAAO,CAAC9P,GAAR,CAAY;EACV1D,EAAAA,GAAG,EAAHA,GADU;EAEVkF,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAOlY,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAAC8sB,KAAP,GAAeA,KAAf;EACD;;;;;;;;"} \ No newline at end of file diff --git a/src/node/Img.js b/src/node/Img.js index c8114572b..ea4dde081 100644 --- a/src/node/Img.js +++ b/src/node/Img.js @@ -336,7 +336,7 @@ class Img extends Dom { root.__addUpdate({ node: self, focus: level.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行 - img: true, // 特殊标识强制布局即便没有style变化 + img: true, // 特殊标识强制布局即便没有style变化 TODO }); }, }); diff --git a/src/node/Root.js b/src/node/Root.js index f6e653c0f..00b623b26 100644 --- a/src/node/Root.js +++ b/src/node/Root.js @@ -564,7 +564,7 @@ class Root extends Dom { } // reflow/repaint/measure相关的记录下来 let isRepaint = level.isRepaint(lv); - if(isRepaint) { console.log(node.tagName); + if(isRepaint) { // zIndex变化需清空svg缓存 if(hasZ && renderMode === mode.SVG) { node.__cancelCacheSvg(true); @@ -867,8 +867,10 @@ class Root extends Dom { // OFFSET的话先递归看子节点,本身改变放在最后 let uniqueList = []; node.deepScan(function(child, uniqueList) {}, { uniqueList }); - uniqueList.push(o); - options.uniqueList = options.uniqueList.concat(uniqueList); + uniqueList.forEach(item => { + options.uniqueList.push(item); + }); + options.uniqueList.push(o); } // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行 diff --git a/test/animate-level-reflow/index.html b/test/animate-level-reflow/index.html deleted file mode 100644 index d2515fe5a..000000000 --- a/test/animate-level-reflow/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - test - - -
- - - - - diff --git a/test/animate-level-reflow/script.jsx b/test/animate-level-reflow/script.jsx deleted file mode 100644 index b7cce37b7..000000000 --- a/test/animate-level-reflow/script.jsx +++ /dev/null @@ -1,28 +0,0 @@ -let o = karas.render( - -
-
-
, - '#test' -); -let t = o.ref.t; -let animation = t.animate([ - { - height: 100, - }, - { - height: 200, - } -], { - duration: 200, - fill: 'forwards', -}); -let input = document.querySelector('input'); -let n = 0; -o.on('refresh', function(lv) { - if(n++ === 0) { - input.value = lv; - } -}); diff --git a/test/animate-level-reflow/test.js b/test/animate-level-reflow/test.js deleted file mode 100644 index 9ce18b0e9..000000000 --- a/test/animate-level-reflow/test.js +++ /dev/null @@ -1,13 +0,0 @@ -let path = require('path'); -let fs = require('fs'); - -module.exports = { - 'init': function(browser) { - browser - .url('file://' + path.join(__dirname, 'index.html')) - .waitForElementVisible('body', 1000) - .pause(500) - .assert.value('input', '1') - .end(); - } -}; diff --git a/test/animate-level-repaint/index.html b/test/animate-level-repaint/index.html deleted file mode 100644 index d2515fe5a..000000000 --- a/test/animate-level-repaint/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - test - - -
- - - - - diff --git a/test/animate-level-repaint/script.jsx b/test/animate-level-repaint/script.jsx deleted file mode 100644 index 01bcee53c..000000000 --- a/test/animate-level-repaint/script.jsx +++ /dev/null @@ -1,23 +0,0 @@ -let o = karas.render( - -
-
-
, - '#test' -); -let t = o.ref.t; -let animation = t.animate([ - { - transform: 'translateX(0)', - }, - { - transform: 'translateX(100px)', - } -], { - duration: 200, - fill: 'forwards', -}); -let input = document.querySelector('input'); -input.value = o.__refreshLevel; diff --git a/test/animate-level-repaint/test.js b/test/animate-level-repaint/test.js deleted file mode 100644 index 985a80747..000000000 --- a/test/animate-level-repaint/test.js +++ /dev/null @@ -1,13 +0,0 @@ -let path = require('path'); -let fs = require('fs'); - -module.exports = { - 'init': function(browser) { - browser - .url('file://' + path.join(__dirname, 'index.html')) - .waitForElementVisible('body', 1000) - .pause(500) - .assert.value('input', '0') - .end(); - } -}; diff --git a/test/animate-mask-svg/test.js b/test/animate-mask-svg/test.js index 0447f1ec5..0cf453bec 100644 --- a/test/animate-mask-svg/test.js +++ b/test/animate-mask-svg/test.js @@ -7,7 +7,7 @@ module.exports = { .url('file://' + path.join(__dirname, 'index.html')) .waitForElementVisible('body', 1000) .pause(500) - .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",14.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"looooooooooooooong"}]}],"opacity":1,"type":"dom"},{"bb":[{"type":"item","tagName":"rect","props":[["x",5],["y",10],["width",100],["height",100],["fill","rgba(255,0,0,1)"]]}],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",5],["y",24.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}]}],"opacity":1,"type":"dom","mask":"url(#karas-defs-0-0)"}],"opacity":1,"type":"dom","defs":[{"tagName":"mask","props":[],"children":[{"type":"item","tagName":"path","props":[["d","M50,0L150,100L50,100L50,0"],["fill","rgba(238,238,238,1)"],["stroke","rgba(0,0,0,1)"],["stroke-width",0],["transform","matrix(1,0,0,1,0,0)"]]}],"uuid":"karas-defs-0-0"}]}') + .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",14.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"looooooooooooooong"}],"cache":true}],"opacity":1,"type":"dom","cache":true},{"bb":[{"type":"item","tagName":"rect","props":[["x",5],["y",10],["width",100],["height",100],["fill","rgba(255,0,0,1)"]]}],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",5],["y",24.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}],"cache":true}],"opacity":1,"type":"dom","mask":"url(#karas-defs-0-0)","cache":true}],"opacity":1,"type":"dom","defs":[{"tagName":"mask","props":[],"children":[{"type":"item","tagName":"path","props":[["d","M50,0L150,100L50,100L50,0"],["fill","rgba(238,238,238,1)"],["stroke","rgba(0,0,0,1)"],["stroke-width",0],["transform","matrix(1,0,0,1,0,0)"]]}],"uuid":"karas-defs-0-0"}],"cache":true}') .end(); } }; diff --git a/test/animate-relative-top-svg/test.js b/test/animate-relative-top-svg/test.js index 14d23bebb..4363c6cf7 100644 --- a/test/animate-relative-top-svg/test.js +++ b/test/animate-relative-top-svg/test.js @@ -7,7 +7,7 @@ module.exports = { .url('file://' + path.join(__dirname, 'index.html')) .waitForElementVisible('body', 1000) .pause(500) - .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",114.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}]}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[]}') + .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",114.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}]}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[],"cache":true}') .end(); } };