diff --git a/index.js b/index.js index 7d912f826..c709ceba2 100644 --- a/index.js +++ b/index.js @@ -5532,8 +5532,13 @@ }, { key: "render", value: function render(renderMode, ctx) { + var vd = this.__virtualDom = { + type: 'text', + children: [] + }; var isDestroyed = this.isDestroyed, - computedStyle = this.computedStyle; + computedStyle = this.computedStyle, + lineBoxes = this.lineBoxes; if (isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') { return; @@ -5544,17 +5549,14 @@ ctx.fillStyle = util.int2rgba(computedStyle.color); } - this.lineBoxes.forEach(function (item) { + lineBoxes.forEach(function (item) { item.render(renderMode, ctx, computedStyle); }); if (renderMode === mode.SVG) { - this.__virtualDom = { - type: 'text', - children: this.lineBoxes.map(function (lineBox) { - return lineBox.virtualDom; - }) - }; + vd.children = lineBoxes.map(function (lineBox) { + return lineBox.virtualDom; + }); } } }, { diff --git a/index.js.map b/index.js.map index 14ab24b8d..c652331d2 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/node/Node.js","src/util/util.js","src/node/tool.js","src/util/mode.js","src/style/reset.js","src/style/unit.js","src/math/matrix.js","src/math/geom.js","src/math/tar.js","src/math/index.js","src/style/transform.js","src/style/reg.js","src/style/gradient.js","src/style/border.js","src/style/font.js","src/style/css.js","src/style/image.js","src/node/LineBox.js","src/node/Text.js","src/util/Event.js","src/animate/level.js","src/animate/repaint.js","src/node/Component.js","src/util/inject.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/util/draw.js","src/node/Xom.js","src/node/LineGroup.js","src/node/Dom.js","src/node/Img.js","src/util/diff.js","src/node/Defs.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/util/abbr.js","src/util/parse.js","src/index.js"],"sourcesContent":["class Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative/margin:auto/text-align等造成的偏移量\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","let toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\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) {\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) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, mask, filter } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask') {\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 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\nfunction equalArr(a, b) {\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 if(ai !== bi) {\n return false;\n }\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 = keys.length;\n while(i--) {\n let k = keys[i];\n target[k] = source[k];\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\nlet util = {\n isObject: isType('Object'),\n isString: isType('String'),\n isFunction: isType('Function'),\n isNumber: isType('Number'),\n isBoolean: isType('Boolean'),\n isDate: isType('Date'),\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\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 extend,\n joinArr,\n};\n\nexport default util;\n","import util from '../util/util';\n\nfunction init(target, root, host) {\n let ref = target.props.ref;\n if(util.isString(ref) && ref) {\n root.ref[ref] = target;\n }\n else if(util.isFunction(ref)) {\n ref(target);\n }\n target.__root = root;\n target.__host = host;\n}\n\nexport default {\n init,\n};\n","export default {\n CANVAS: 0,\n SVG: 1,\n};\n","import util from '../util/util';\n\nconst 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};\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 = [];\nlet domKey = [];\nObject.keys(DOM).forEach(k => {\n domKey.push(k);\n let v = DOM[k];\n dom.push({\n k,\n v,\n });\n});\n\nlet geom = [];\nlet geomKey = [];\nObject.keys(GEOM).forEach(k => {\n geomKey.push(k);\n let v = GEOM[k];\n geom.push({\n k,\n v,\n });\n});\n\nexport default {\n DOM,\n GEOM,\n domKey,\n geomKey,\n dom,\n geom,\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","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n// 矩阵a*b,固定两个matrix都是长度6\nfunction multiply(a, b) {\n return [\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 a[0] * b[4] + a[2] * b[5] + a[4],\n a[1] * b[4] + a[3] * b[5] + a[5]\n ];\n}\n\nfunction calPoint(point, m) {\n let [x, y] = point;\n return [\n m[0] * x + m[2] * y + m[4],\n m[1] * x + m[3] * y + m[5],\n ];\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\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\nfunction transformPoint(matrix, x, y) {\n let [a, b, c, d, e, f] = matrix;\n return [a * x + c * y + e, b * x + d * y + f];\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\nexport default {\n vectorProduct,\n pointInPolygon,\n transformPoint,\n d2r(n) {\n return n * Math.PI / 180;\n },\n r2d(n) {\n return n * 180 / Math.PI;\n },\n // 贝塞尔曲线模拟1/4圆弧比例\n H: 4 * (Math.sqrt(2) - 1) / 3,\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};\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 // 第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为基准,缩放ab至目标相同长度\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 ls = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n lt = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n if(ls !== lt) {\n let scale = lt / ls;\n t = matrix.identity();\n t[3] = scale;\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 // 第5步,再次旋转,角度为目标旋转到x轴的负值\n if(alpha !== 0) {\n t = rotate(alpha);\n m = matrix.multiply(t, m);\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","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 { d2r, transformPoint } = 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 = matrix.identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = matrix.identity();\n calSingle(t, k, v);\n m = matrix.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 = matrix.identity();\n t[4] = ox;\n t[5] = oy;\n let res = matrix.multiply(t, m);\n let t2 = matrix.identity();\n t2[4] = -ox;\n t2[5] = -oy;\n res = matrix.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] = transformPoint(matrix, x1, y1);\n [x2, y2] = transformPoint(matrix, x2, y2);\n [x4, y4] = transformPoint(matrix, x4, y4);\n [x3, y3] = transformPoint(matrix, x3, y3);\n return geom.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 - (main2 - y1) * Math.tan(deg1);\n cross2 = x4 - (main1 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main2],\n [cross2, main1],\n [x4, main1],\n [x4, 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 - (main1 - x1) * Math.tan(deg2);\n cross2 = y4 - (main2 - x1) * 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 - x1) * 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 - x1) * 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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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\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","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport util from '../util/util';\n\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING } = unit;\nconst { isNil, rgba2int } = util;\n\nconst DEFAULT_FONT_SIZE = 16;\n\nfunction parserOneBorder(style, direction) {\n let k = 'border' + direction;\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\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis;\n }\n}\n\nfunction parseMarginPadding(style, key) {\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 ['Top', 'Right', 'Bottom', 'Left'].forEach((k, i) => {\n k = key + k;\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n delete style[key];\n }\n}\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$/.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PX,\n };\n }\n else if(/deg$/.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 标准化的样式\n */\nfunction normalize(style, reset = []) {\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n if(isNil(style[k])) {\n style[k] = temp;\n }\n });\n delete style.border;\n }\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n parserOneBorder(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Width';\n if(isNil(style[k])) {\n // width后面会统一格式化处理\n style[k] = temp;\n }\n });\n delete style.borderWidth;\n }\n temp = style.borderColor;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n if(isNil(style[k])) {\n style[k] = rgba2int(temp);\n }\n });\n delete style.borderColor;\n }\n temp = style.borderStyle;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Style';\n if(isNil(style[k])) {\n style[k] = temp;\n }\n });\n delete style.borderStyle;\n }\n temp = style.borderRadius;\n if(temp) {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n temp = temp.toString().split('/');\n if(temp.length === 1) {\n temp[1] = temp[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = temp[i].toString().split(/\\s+/);\n if(item.length === 0) {\n temp[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n temp[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n temp[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n temp[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n temp[i] = item.slice(0, 4);\n }\n }\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach((k, i) => {\n k = 'border' + k + 'Radius';\n if(isNil(style[k])) {\n style[k] = temp[0][i] + ' ' + temp[1][i];\n }\n });\n delete style.borderRadius;\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n // gradient/image和颜色可以并存\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(temp);\n if(gd) {\n style.backgroundImage = gd[0];\n temp = temp.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(temp);\n if(img) {\n style.backgroundImage = img[0];\n temp = temp.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-)?repeat(-[xy])?/i.exec(temp);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\))/i.exec(temp);\n if(bgc) {\n style.backgroundColor = bgc[0];\n temp = temp.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = temp.match(reg.position);\n if(position) {\n style.backgroundPositionX = position[0];\n style.backgroundPositionY = position.length > 1 ? position[1] : position[0];\n }\n }\n delete style.background;\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n temp = temp.toString().split(/\\s+/);\n if(temp.length === 1) {\n temp[1] = '50%';\n }\n [style.backgroundPositionX, style.backgroundPositionY] = temp;\n delete style.backgroundPosition;\n }\n // flex\n temp = style.flex;\n if(temp) {\n if(temp === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(temp === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+$/.test(temp)) {\n parseFlex(style, Math.max(0, parseFloat(temp)), 1, 0);\n }\n else if(/^[\\d.]+px$/.test(temp)) {\n parseFlex(style, 1, 1, 0);\n }\n else if(/^[\\d.]+%$/.test(temp)) {\n parseFlex(style, 1, 1, temp);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(temp)) {\n let arr = temp.split(/\\s+/);\n parseFlex(style, arr[0], arr[1], 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+%$/.test(temp)) {\n let arr = temp.split(/\\s+/);\n parseFlex(style, arr[0], 1, arr[1]);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n delete style.flex;\n }\n // margin\n parseMarginPadding(style, 'margin');\n parseMarginPadding(style, 'padding');\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 // 默认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$/.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$/.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$/.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$/.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 // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n style[k + 'X'] = arr[0];\n style[k + 'Y'] = arr[1];\n delete style[k];\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$/.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*\\)/.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 return style;\n}\n\n// 影响文字测量的只有字体和大小,必须提前处理,另顺带处理掉布局相关的属性\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小,也需要提前处理\n * 继承相关的计算,包括布局的,以及渲染repaint的\n * @param node\n * @param isRoot\n */\nfunction compute(node, isRoot) {\n let { animateStyle } = node;\n let currentStyle = node.__currentStyle = animateStyle;\n let computedStyle = node.__computedStyle = {};\n let parentComputedStyle = isRoot ? null : node.parent.computedStyle;\n let { fontSize, fontFamily, textAlign, lineHeight } = currentStyle;\n if(fontSize.unit === INHERIT) {\n computedStyle.fontSize = isRoot ? DEFAULT_FONT_SIZE : parentComputedStyle.fontSize;\n }\n else if(fontSize.unit === PERCENT) {\n computedStyle.fontSize = isRoot ? DEFAULT_FONT_SIZE : parentComputedStyle.fontSize * fontSize.value * 0.01;\n }\n else {\n computedStyle.fontSize = fontSize.value;\n }\n if(fontFamily.unit === INHERIT) {\n computedStyle.fontFamily = isRoot ? 'arial' : parentComputedStyle.fontFamily;\n }\n else {\n computedStyle.fontFamily = fontFamily.value;\n }\n // 顺带将可提前计算且与布局相关的属性提前计算到computedStyle上,渲染相关的在各自render中做\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 repaint(node, isRoot, currentStyle);\n}\n\n// REPAINT等级下,刷新前首先执行,如继承等提前计算computedStyle\nfunction repaint(node, isRoot, currentStyle) {\n if(!currentStyle) {\n let { animateStyle } = node;\n currentStyle = node.__currentStyle = animateStyle;\n }\n let computedStyle = node.computedStyle;\n let parentComputedStyle = isRoot ? null : node.parent.computedStyle;\n let { fontStyle, fontWeight, color, visibility } = currentStyle;\n if(fontStyle.unit === INHERIT) {\n computedStyle.fontStyle = isRoot ? 'normal' : parentComputedStyle.fontStyle;\n }\n else {\n computedStyle.fontStyle = fontStyle.value;\n }\n if(fontWeight.unit === INHERIT) {\n computedStyle.fontWeight = isRoot ? 400 : parentComputedStyle.fontWeight;\n }\n else {\n computedStyle.fontWeight = fontWeight.value;\n }\n if(color.unit === INHERIT) {\n computedStyle.color = isRoot ? [0, 0, 0, 1] : parentComputedStyle.color;\n }\n else {\n computedStyle.color = color.value;\n }\n if(visibility === 'inherit') {\n computedStyle.visibility = isRoot ? 'visible' : parentComputedStyle.visibility;\n }\n else {\n computedStyle.visibility = visibility;\n }\n [\n 'opacity',\n 'zIndex',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundRepeat',\n 'backgroundImage',\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 computedStyle[k] = currentStyle[k].value;\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\nexport default {\n normalize,\n compute,\n repaint,\n setFontStyle,\n getBaseLine,\n calRelative,\n calAbsolute,\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","import css from '../style/css';\nimport util from '../util/util';\nimport mode from '../util/mode';\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) {\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', util.int2rgba(computedStyle.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 css from '../style/css';\nimport mode from '../util/mode';\nimport util from '../util/util';\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__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 __measure(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 __renderByMask(renderMode, ctx) {\n this.render(renderMode, ctx);\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 const { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') {\n return;\n }\n if(renderMode === mode.CANVAS) {\n ctx.font = css.setFontStyle(computedStyle);\n ctx.fillStyle = util.int2rgba(computedStyle.color);\n }\n this.lineBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle);\n });\n if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'text',\n children: this.lineBoxes.map(lineBox => lineBox.virtualDom),\n };\n }\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\nexport default Text;\n","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","export default {\n REPAINT: 0,\n REFLOW: 1,\n};\n","export default {\n GEOM: {\n x1: true,\n y1: true,\n x2: true,\n y2: true,\n controlA: true,\n controlB: true,\n r: true,\n rx: true,\n ry: true,\n begin: true,\n end: true,\n points: true,\n controls: true,\n },\n STYLE: {\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 },\n};\n","import Node from './Node';\nimport Text from './Text';\nimport tool from './tool';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport css from '../style/css';\nimport level from '../animate/level';\nimport repaint from '../animate/repaint';\n\nconst { isNil, isString, isFunction, clone, extend } = util;\n\nclass Component extends Event {\n constructor(tagName, props, children) {\n super();\n if(!isString(tagName)) {\n children = props;\n props = tagName;\n tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n }\n this.__tagName = tagName;\n props = props || [];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n this.__props = props;\n }\n else {\n this.props = props;\n this.__props = util.hash2arr(props);\n }\n this.__children = children || [];\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.__state = {};\n this.__isMount = false;\n }\n\n setState(n, cb) {\n if(isNil(n)) {\n this.state = {};\n }\n else {\n extend(this.state, n);\n }\n let root = this.root;\n if(root) {\n root.delRefreshTask(this.__task);\n let ovd = this.shadowRoot;\n this.__task = {\n before: () => {\n this.__init(root, this);\n root.setRefreshLevel(level.REFLOW);\n },\n after: () => {\n if(ovd instanceof Node) {\n ovd.__destroy();\n }\n if(isFunction(cb)) {\n cb();\n }\n },\n };\n root.addRefreshTask(this.__task);\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n cb();\n }\n }\n\n __create() {\n let sr = this.render();\n // 可能返回的还是一个Component,递归处理\n while(sr instanceof Component) {\n sr = sr.render();\n }\n if(sr instanceof Node) {\n // 组件传入的样式需覆盖shadowRoot的\n let style = clone(this.props.style) || {};\n css.normalize(style);\n extend(sr.style, style);\n // 事件添加到sr,以及自定义事件\n this.__props.forEach(item => {\n let k = item[0];\n let v = item[1];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n let arr = sr.listener[k] = sr.listener[k] || [];\n if(arr.indexOf(v) === -1) {\n arr.push(v);\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, function(...args) {\n v(...args);\n });\n }\n });\n }\n else {\n let s = '';\n if(!isNil(sr)) {\n s = util.encodeHtml(sr.toString());\n }\n sr = new Text(s);\n }\n return this.__shadowRoot = sr;\n }\n\n __init(root, host) {\n tool.init(this, root, host);\n let sr = this.__create();\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点\n sr.__parent = this.parent;\n sr.__host = host;\n }\n else {\n sr.__init(root, this);\n }\n }\n\n render() {\n }\n\n __destroy() {\n let { componentWillUnmount } = this;\n if(isFunction(componentWillUnmount)) {\n componentWillUnmount.call(this);\n this.__isMount = false;\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.children.splice(0);\n this.__shadowRoot = null;\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n if(force) {\n return sr.__emitEvent(e, force);\n }\n let res = sr.__emitEvent(e);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n // Root布局前时measure调用,第一次渲染初始化生成shadowRoot\n __measure(renderMode, ctx) {\n let { root } = this;\n if(!this.__isMount) {\n this.__isMount = true;\n let { componentDidMount } = this;\n if(isFunction(componentDidMount)) {\n root.once(Event.REFRESH, () => {\n componentDidMount.call(this);\n });\n }\n }\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n sr.__measure(renderMode, ctx);\n }\n else {\n sr.__measure(renderMode, ctx, true);\n }\n }\n\n __repaint() {\n let sr = this.shadowRoot;\n if(!(sr instanceof Text)) {\n sr.__repaint(true);\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get children() {\n return this.__children;\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\nObject.keys(repaint.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]).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].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","import Text from '../node/Text';\rimport util from './util';\r\rconst SPF = 1000 / 60;\r\rconst CANVAS = {\r cache: null,\r mask: null,\r};\r\rfunction cacheCanvas(key, width, height) {\r let o;\r if(!CANVAS[key]) {\r o = CANVAS[key] = document.createElement('canvas');\r o.style.position = 'absolute';\r o.style.left = '9999px';\r o.style.top = '-9999px';\r document.body.append(o);\r }\r o = CANVAS[key];\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\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`;\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 performance.now();\r }\r inject.now = Date.now.bind(Date);\r return Date.now();\r },\r getCacheCanvas(width, height) {\r return cacheCanvas('cache', width, height);\r },\r getMaskCanvas(width, height) {\r return cacheCanvas('mask', 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 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\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(!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(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n get task() {\n return this.__task;\n }\n\n get aTask() {\n return this.__aTask;\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 util from '../util/util';\nimport Event from '../util/Event';\nimport frame from './frame';\nimport easing from './easing';\nimport level from './level';\nimport repaint from './repaint';\n\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER } = unit;\nconst { isNil, isFunction, isNumber, isObject, clone, equalArr } = util;\nconst { linear } = easing;\n\nconst 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\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)) {\n if(repaint.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// 对比两个样式的某个值是否相等\nfunction equalStyle(k, a, b) {\n if(k === 'transform') {\n return equalArr(a[0][1], b[0][1]);\n }\n else 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(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n else 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 else 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 else 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 else if(COLOR_HASH.hasOwnProperty(k)) {\n return a.unit === b.unit && equalArr(a.value, b.value);\n }\n else 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 else if(repaint.GEOM.hasOwnProperty(k)) {\n if(k === 'points' || k === 'controls') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(a[i] === b[i]) {\n continue;\n }\n if(a[i][0] !== b[i][0] || a[i][1] !== b[i][1]) {\n return false;\n }\n }\n return true;\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(a.length !== b.length) {\n return false;\n }\n return a[0] === b[0] && a[1] === b[1];\n }\n }\n return a === b;\n}\n\nfunction isStyleReflow(k) {\n return !repaint.STYLE.hasOwnProperty(k) && !repaint.GEOM.hasOwnProperty(k);\n}\n\n// 计算是否需要刷新和刷新等级,新样式和之前样式对比\nfunction calRefresh(frameStyle, lastStyle, keys) {\n let res = false;\n let lv = level.REPAINT;\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let n = frameStyle[k];\n let p = lastStyle[k];\n // 前后均非空对比\n if(!isNil(n) && !isNil(p)) {\n if(!equalStyle(k, n, p)) {\n res = true;\n // 不相等且刷新等级是重新布局时可以提前跳出\n if(lv === level.REPAINT) {\n if(isStyleReflow(k)) {\n lv = level.REFLOW;\n break;\n }\n }\n else {\n break;\n }\n }\n }\n // 有一个为空时即不等\n else if(!isNil(n) || !isNil(p)) {\n res = true;\n if(isStyleReflow(k)) {\n lv = level.REFLOW;\n break;\n }\n }\n }\n return [res, lv];\n}\n\n// 将当前frame的style赋值给动画style,xom绘制时获取\nfunction genBeforeRefresh(frameStyle, animation, root, lv) {\n root.setRefreshLevel(lv);\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n root.__frameHook();\n let style = {};\n let props = {};\n Object.keys(frameStyle).forEach(i => {\n let v = frameStyle[i];\n if(isNil(v)) {\n return;\n }\n // geom的属性变化\n if(repaint.GEOM.hasOwnProperty(i)) {\n props[i] = v;\n style[i] = v;\n }\n // 样式\n else {\n style[i] = v;\n }\n });\n animation.__style = style;\n animation.__props = props;\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 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(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 res.n = p;\n return res;\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 res.n = p;\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 let computedStyle = target.computedStyle;\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 if(p.unit === AUTO || n.unit === AUTO) {\n res.n = p;\n return res;\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(repaint.GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n res.n = null;\n }\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p)) {\n return p;\n }\n if(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(nv);\n }\n else {\n let v = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n if(isNil(pv[j]) || isNil(nv[j])) {\n v.push(nv[j]);\n }\n else {\n v.push(nv[j] - pv[j]);\n }\n }\n res.v.push(v);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p)) {\n return p;\n }\n if(equalArr(p, n)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1]\n ];\n }\n else {\n if(n === p) {\n return;\n }\n res.v = n - p;\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 if(n === p) {\n return;\n }\n res.n = p;\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 * @returns {*}\n */\nfunction calIntermediateStyle(frame, percent) {\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, n, d, p } = item;\n let st = style[k];\n // 没有中间态的如display\n if(item.hasOwnProperty('n')) {\n style[k] = n;\n }\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n else 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(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(repaint.GEOM.hasOwnProperty(k)) {\n let st = style[k];\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n if(isNil(st[i]) || !st[i].length) {\n continue;\n }\n for(let j = 0, len2 = Math.min(st[i].length, v[i].length); j < len2; j++) {\n if(!isNil(st[i][j]) && !isNil(v[i][j])) {\n st[i][j] += v[i][j] * percent;\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n }\n else {\n style[k] += v * percent;\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.__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 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 }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\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 // 再计算两帧之间的变化,存入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 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 }\n }\n else {\n this.__playCount = this.__currentTime = 0;\n this.__playState = 'idle';\n this.__style = {};\n }\n };\n // 生成finish的任务事件\n this.__fin = (cb) => {\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();\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 keys,\n __clean,\n __fin,\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, style, 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 let needRefresh, lv;\n // 还没过前置delay\n if(currentTime < delay) {\n if(stayBegin) {\n let current = frames[0].style;\n // 对比第一帧,以及和第一帧同key的当前样式\n [needRefresh, lv] = calRefresh(current, style, keys);\n if(needRefresh) {\n genBeforeRefresh(current, this, root, lv);\n }\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 [needRefresh, lv] = calRefresh(current, style, keys);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = {};\n [needRefresh, lv] = calRefresh(current, style, keys);\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);\n [needRefresh, lv] = calRefresh(current, style, keys);\n }\n // 两帧之间没有变化,不触发刷新仅触发frame事件,有变化生成计算结果赋给style\n if(needRefresh) {\n genBeforeRefresh(current, this, root, lv);\n }\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 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.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, style, keys, frames, __frameCb, __clean, __fin } = self;\n if(root) {\n let needRefresh, lv, current;\n // 停留在最后一帧\n if(self.__stayEnd()) {\n current = frames[frames.length - 1].style;\n [needRefresh, lv] = calRefresh(current, style, keys);\n }\n else {\n current = {};\n [needRefresh, lv] = calRefresh(current, style, keys);\n }\n if(needRefresh) {\n frame.nextFrame(this.__enterFrame = {\n before: () => {\n genBeforeRefresh(current, this, root, lv);\n __clean(true);\n },\n after: diff => {\n __frameCb(diff);\n __fin(cb);\n },\n });\n }\n // 无刷新同步进行\n else {\n __clean(true);\n __fin(cb);\n }\n }\n return self;\n }\n\n cancel(cb) {\n let { isDestroyed, duration, playState, list } = this;\n if(isDestroyed || duration <= 0 || playState === 'idle' || list.length < 1) {\n return this;\n }\n this.__cancelTask();\n let { root, style, keys, __frameCb, __clean } = this;\n if(root) {\n let [needRefresh, lv] = calRefresh({}, style, keys);\n let task = () => {\n this.__cancelTask();\n this.__begin = this.__end = this.__isDelay = this.__finish = this.__inFps = this.__enterFrame = null;\n this.emit(Event.CANCEL);\n if(isFunction(cb)) {\n cb();\n }\n };\n if(needRefresh) {\n frame.nextFrame(this.__enterFrame = {\n before: () => {\n genBeforeRefresh({}, this, root, lv);\n __clean();\n },\n after: diff => {\n __frameCb(diff);\n task();\n },\n });\n }\n // 无刷新同步进行\n else {\n __clean();\n task();\n }\n }\n return this;\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 __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() {\n this.__clean && this.__clean();\n this.__startTime = null;\n this.__isDestroyed = true;\n this.removeControl();\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 props() {\n return this.__props;\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\nexport default Animation;\n","function genCanvasPolygon(ctx, list) {\n ctx.beginPath();\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(item.length === 2) {\n ctx.lineTo(item[0], item[1]);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0], item[1], item[2], item[3]);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0], item[1], item[2], item[3], item[4], item[5]);\n }\n }\n ctx.fill();\n ctx.closePath();\n}\n\nfunction genSvgPolygon(list) {\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(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 // s += `L${list[0][0]},${list[0][1]}`;\n return s;\n}\n\nexport default {\n genCanvasPolygon,\n genSvgPolygon,\n};\n","import Node from './Node';\nimport tool from './tool';\nimport mode from '../util/mode';\nimport reset from '../style/reset';\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 util from '../util/util';\nimport Component from './Component';\nimport Animation from '../animate/Animation';\nimport inject from '../util/inject';\nimport draw from '../util/draw';\nimport mx from '../math/matrix';\n\nconst { AUTO, PX, PERCENT, STRING } = unit;\nconst { clone, int2rgba, equalArr, extend, joinArr } = util;\nconst { calRelative, compute, repaint } = css;\nconst { genCanvasPolygon, genSvgPolygon } = draw;\n\nfunction renderBorder(renderMode, points, color, ctx, xom) {\n color = int2rgba(color);\n if(renderMode === mode.CANVAS) {\n ctx.fillStyle = color;\n points.forEach(point => {\n genCanvasPolygon(ctx, point);\n });\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += genSvgPolygon(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) {\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.fillStyle = color;\n if(list) {\n genCanvasPolygon(ctx, list);\n }\n else {\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.fill();\n ctx.closePath();\n }\n }\n else if(renderMode === mode.SVG) {\n if(list) {\n let d = genSvgPolygon(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 item.value;\n }\n else {\n return 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\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 this.__props = props;\n }\n else {\n this.props = props;\n this.__props = util.hash2arr(props);\n }\n this.__tagName = tagName;\n // 引用如json时由于直接normalize处理style对象,需clone防止影响,比如再次渲染时style格式错误\n this.__style = clone(this.props.style) || {}; // style被解析后的k-v形式\n this.__currentStyle = this.__style; // 动画过程中绘制一开始会merge动画样式\n this.__listener = {};\n this.__props.forEach(item => {\n let k = item[0];\n let v = item[1];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n let arr = this.__listener[k] = this.__listener[k] || [];\n if(arr.indexOf(v) === -1) {\n arr.push(v);\n }\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\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标明先假布局一次计算尺寸\n __layout(data, isVirtual, fromAbs) {\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 computedStyle.width = computedStyle.height = 0;\n return;\n }\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种布局\n if(display === 'block') {\n this.__layoutBlock(data, isVirtual);\n }\n else if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inline') {\n this.__layoutInline(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 // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n let ac = this.root.animateController;\n ac.__records = ac.records.concat(ar);\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 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 } = this;\n // 圆角边计算\n calBorderRadius(outerWidth, outerHeight, currentStyle, computedStyle);\n let {\n display,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n backgroundColor,\n borderTopWidth,\n borderTopColor,\n borderTopStyle,\n borderRightWidth,\n borderRightColor,\n borderRightStyle,\n borderBottomWidth,\n borderBottomColor,\n borderBottomStyle,\n borderLeftWidth,\n borderLeftColor,\n borderLeftStyle,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n backgroundRepeat,\n backgroundImage,\n opacity,\n filter,\n } = computedStyle;\n let {\n backgroundSize,\n backgroundPositionX,\n backgroundPositionY,\n transform,\n transformOrigin,\n } = currentStyle;\n // 使用sx和sy渲染位置,考虑了relative和translate影响\n let { sx: x, sy: y } = this;\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 // 先设置透明度,canvas可以向上累积\n if(renderMode === mode.CANVAS) {\n let parent = this.parent;\n while(parent) {\n opacity *= parent.computedStyle.opacity;\n parent = parent.parent;\n }\n ctx.globalAlpha = opacity;\n }\n else {\n this.__virtualDom.opacity = opacity;\n }\n // transform和transformOrigin相关\n let tfo = tf.calOrigin(transformOrigin, outerWidth, outerHeight);\n computedStyle.transformOrigin = tfo.slice(0);\n tfo[0] += x;\n tfo[1] += y;\n // canvas继承祖先matrix,没有则恢复默认,防止其它matrix影响;svg则要考虑事件\n let matrix = [1, 0, 0, 1, 0, 0];\n this.__matrix = computedStyle.matrix = matrix;\n if(isDestroyed || display === 'none') {\n return;\n }\n let parent = this.parent;\n // transform相对于自身\n if(transform) {\n matrix = tf.calMatrix(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;\n matrix = tf.calMatrixByOrigin(matrix, tfo);\n let renderMatrix = matrix;\n // 变换对事件影响,canvas要设置渲染\n if(parent) {\n if(parent.matrixEvent) {\n matrix = mx.multiply(parent.matrixEvent, matrix);\n // break;\n }\n // parent = parent.parent;\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 computedStyle.backgroundPositionX = backgroundPositionX.unit === PX\n ? backgroundPositionX.value : backgroundPositionX.value * innerWidth;\n computedStyle.backgroundPositionY = backgroundPositionY.unit === PX\n ? backgroundPositionY.value : backgroundPositionY.value * innerWidth;\n backgroundSize = calBackgroundSize(backgroundSize, innerWidth, innerHeight);\n computedStyle.backgroundSize = backgroundSize;\n // 隐藏不渲染\n if(visibility === 'hidden') {\n computedStyle.visibility = 'hidden';\n return;\n }\n // 背景色垫底\n if(backgroundColor[3] > 0) {\n renderBgc(renderMode, int2rgba(backgroundColor), x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n let loadBgi = this.__loadBgi;\n if(util.isString(backgroundImage)) {\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\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 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 let c;\n let currentCtx;\n // 在离屏canvas上绘制\n if(needMask) {\n let { width, height } = this.root;\n c = inject.getCacheCanvas(width, height);\n currentCtx = c.ctx;\n // 和当前画布matrix一致,防止当前设置值导致离屏绘制超出边界\n currentCtx.setTransform(...matrix);\n }\n else {\n currentCtx = ctx;\n }\n // 先画不考虑repeat的中心声明的\n currentCtx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n currentCtx.drawImage(source, item[0], item[1], w, h);\n });\n // mask特殊处理画回来\n if(needMask) {\n currentCtx.globalCompositeOperation = 'destination-in';\n renderBgc(renderMode, '#FFF', x2, y2, innerWidth, innerHeight, currentCtx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n // 将离屏内容绘制回来时先重置默认matrix,因为离屏已经保持一致\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(c.canvas, 0, 0);\n // 绘完后变正常即可\n ctx.setTransform(...matrix);\n currentCtx.globalCompositeOperation = 'source-over';\n let { width, height } = this.root;\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.clearRect(0, 0, width, height);\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 maskId = defs.add({\n tagName: 'mask',\n props: [],\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.bbMask = 'url(#' + maskId + ')';\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 else {\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 this.root.delRefreshTask(loadBgi.cb);\n this.root.addRefreshTask(loadBgi.cb);\n }\n }, {\n width: innerWidth,\n height: innerHeight,\n });\n }\n }\n else if(backgroundImage.k) {\n let bgi = this.__gradient(renderMode, ctx, defs, x2, y2, x3, y3, innerWidth, innerHeight, backgroundImage);\n renderBgc(renderMode, bgi, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\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, 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, 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, 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, borderLeftColor, ctx, this);\n }\n if(filter) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0 && renderMode === mode.SVG) {\n // 模糊框卷积尺寸 #66\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 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\n __renderByMask(renderMode, ctx, defs) {\n let { prev, root } = this;\n let hasMask = prev && prev.isMask;\n if(!hasMask) {\n this.render(renderMode, ctx, defs);\n return;\n }\n if(renderMode === mode.CANVAS) {\n // canvas借用2个离屏canvas来处理,c绘制本xom,m绘制多个mask\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height);\n this.render(renderMode, c.ctx);\n // 收集之前的mask列表\n let list = [];\n while(prev && prev.isMask) {\n list.unshift(prev);\n prev = prev.prev;\n }\n // 当mask只有1个时,无需生成m,直接在c上即可\n if(list.length === 1) {\n prev = list[0];\n c.ctx.globalCompositeOperation = 'destination-in';\n prev.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.getMaskCanvas(width, height);\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 // 清除\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, width, height);\n c.draw(c.ctx);\n }\n else if(renderMode === mode.SVG) {\n this.render(renderMode, ctx, defs);\n // 作为mask会在defs生成maskId供使用,多个连续mask共用一个id\n this.virtualDom.mask = prev.maskId;\n }\n }\n\n __destroy() {\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 super.__destroy();\n this.__matrix = this.__matrixEvent = this.__root = null;\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { event: { type } } = e;\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { isGeom, listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n let childWillResponse;\n // touchmove之类强制的直接通知即可\n if(force) {\n if(!isGeom) {\n // 先响应absolute/relative高优先级,再看普通流,综合zIndex和从后往前遮挡顺序\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, force)) {\n childWillResponse = true;\n }\n }\n }\n }\n // touchmove之类也需要考虑target是否是自己以及孩子\n if(!childWillResponse && this.root.__touchstartTarget !== this) {\n return;\n }\n if(e.__stopPropagation) {\n return;\n }\n if(['touchmove', 'touchend', 'touchcancel'].indexOf(type) > -1) {\n e.target = this.root.__touchstartTarget;\n }\n if(cb) {\n cb.forEach(item => {\n if(e.__stopImmediatePropagation) {\n return;\n }\n item(e);\n });\n }\n return true;\n }\n if(!isGeom) {\n // 先响应absolute/relative高优先级,再看普通流,综合zIndex和从后往前遮挡顺序\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 childWillResponse = true;\n }\n }\n }\n }\n if(e.__stopPropagation) {\n return;\n }\n // child触发则parent一定触发,否则判断事件坐标是否在节点内且未被遮挡\n if(childWillResponse || this.willResponseEvent(e)) {\n e.__hasEmitted = true;\n if(cb) {\n cb.forEach(item => {\n if(e.__stopImmediatePropagation) {\n return;\n }\n if(util.isFunction(item)) {\n item(e);\n }\n });\n }\n return true;\n }\n }\n\n willResponseEvent(e) {\n let { x, y, __hasEmitted } = e;\n if(__hasEmitted) {\n return;\n }\n let { sx, sy, outerWidth, outerHeight, matrixEvent } = this;\n let inThis = tf.pointInQuadrilateral(x, y,\n sx, sy,\n sx + outerWidth, sy,\n sx + outerWidth, sy + outerHeight,\n sx, sy + outerHeight,\n matrixEvent);\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 __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 animate(list, options, underControl) {\n if(this.isDestroyed) {\n return;\n }\n let animation = new Animation(this, list, options);\n this.animationList.push(animation);\n if(underControl) {\n this.root.animateController.add(animation);\n }\n if(options.hasOwnProperty('autoPlay') && !options.autoPlay) {\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 __init(root, host) {\n tool.init(this, root, host);\n }\n\n __measure(renderMode, ctx, isRoot) {\n compute(this, isRoot);\n }\n\n __repaint(isRoot) {\n repaint(this, isRoot);\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get isGeom() {\n return this.tagName.charAt(0) === '$';\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 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 animateStyle() {\n let { style, animationList } = this;\n let copy;\n animationList.forEach(item => {\n if(item.animating) {\n if(!copy) {\n copy = extend({}, style, this.isGeom ? reset.domKey.concat(reset.geomKey) : reset.domKey);\n }\n extend(copy, item.style);\n }\n });\n return copy || style;\n }\n\n get currentStyle() {\n return this.__currentStyle;\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);\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.width;\n });\n return width;\n }\n\n get height() {\n let height = 0;\n this.list.forEach(item => {\n height = Math.max(height, item.height);\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\nexport default LineGroup;\n","import Xom from './Xom';\nimport Text from './Text';\nimport LineGroup from './LineGroup';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport mode from '../util/mode';\nimport Component from './Component';\nimport util from '../util/util';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { calAbsolute } = css;\n\nconst TAG_NAME = {\n 'div': true,\n 'span': true,\n 'img': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n};\n\nfunction isRelativeOrAbsolute(node) {\n return ['relative', 'absolute'].indexOf(node.computedStyle.position) > -1;\n}\n\n/**\n * 1. 封装string为Text节点\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点\n */\nfunction flatten(parent, children) {\n let list = [];\n traverse(parent, list, children, {\n lastText: null,\n prev: null,\n });\n return list;\n}\n\nfunction traverse(parent, list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverse(parent, list, item, options);\n });\n }\n else if(children instanceof Xom) {\n if(['canvas', 'svg'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg');\n }\n list.push(children);\n children.__parent = parent;\n options.lastText = null;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n }\n else if(children instanceof Component) {\n list.push(children);\n children.__parent = parent;\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText) {\n options.lastText.content += children;\n }\n else {\n let text = options.lastText = new Text(children);\n list.push(text);\n text.__parent = parent;\n if(options.prev) {\n options.prev.__next = text;\n text.__prev = options.prev;\n }\n options.prev = text;\n }\n }\n}\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(INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n css.normalize(style, reset.dom);\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 } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = computedStyle;\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 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 = borderRightWidth + borderLeftWidth + 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 + borderBottomWidth + 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;\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;\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;\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 // 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);\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 // 只针对绝对定位children布局\n __layoutAbs(container, data) {\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 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 -= computedStyle.borderLeftWidth;\n x2 -= computedStyle.borderRightWidth;\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 -= computedStyle.borderTopWidth;\n y2 -= computedStyle.borderBottomWidth;\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 // 递归进行,遇到absolute/relative的设置新容器\n children.forEach(item => {\n if(item instanceof Dom) {\n item.__layoutAbs(['absolute', 'relative'].indexOf(item.computedStyle.position) > -1 ? 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 super.render(renderMode, ctx, defs);\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) {\n item.__renderAsMask(renderMode, ctx, defs);\n }\n });\n // 按照zIndex排序绘制过滤mask,同时由于svg严格按照先后顺序渲染,没有z-index概念,需要排序将relative/absolute放后面\n let zIndex = this.zIndexChildren;\n // 再绘制relative和absolute\n zIndex.forEach(item => {\n item.__renderByMask(renderMode, ctx, defs);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = zIndex.map(item => item.virtualDom);\n }\n }\n\n __init(root, host) {\n super.__init(root, host);\n (this.__children = flatten(this, this.children))\n .forEach(item => {\n if(item instanceof Xom || item instanceof Component) {\n item.__init(root, host);\n }\n });\n }\n\n __measure(renderMode, ctx, isRoot) {\n super.__measure(renderMode, ctx, isRoot);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__measure(renderMode, ctx);\n });\n }\n\n __repaint(isRoot) {\n super.__repaint(isRoot);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n if(item instanceof Xom || item instanceof Component) {\n item.__repaint();\n }\n });\n }\n\n __destroy() {\n this.children.forEach(child => {\n child.__destroy();\n });\n super.__destroy();\n this.children.splice(0);\n this.lineGroups.splice(0);\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.computedStyle && item.computedStyle.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.computedStyle && item.computedStyle.position === 'absolute';\n });\n }\n\n get zIndexChildren() {\n let noAbs = true;\n let zIndex = this.children.filter((item, i) => {\n // 临时变量为排序使用\n item.__iIndex = i;\n let isXom = item instanceof Xom;\n item.__iXom = isXom;\n if(isXom) {\n let isAbs = isRelativeOrAbsolute(item);\n if(isAbs) {\n item.__iAbs = isAbs;\n noAbs = false;\n }\n }\n // 不是遮罩,并且已有computedStyle,特殊情况下中途插入的节点还未渲染\n return !item.isMask && item.computedStyle;\n });\n // 提前跳出\n if(noAbs) {\n return zIndex;\n }\n zIndex.sort(function(a, b) {\n if(a.__iXom && b.__iXom) {\n if(a.__iAbs && b.__iAbs) {\n if(a.computedStyle.zIndex !== b.computedStyle.zIndex) {\n return a.computedStyle.zIndex - b.computedStyle.zIndex;\n }\n }\n else if(a.__iAbs) {\n return 1;\n }\n else if(b.__iAbs) {\n return -1;\n }\n }\n else if(a.__iXom) {\n if(a.__iAbs) {\n return 1;\n }\n }\n else if(b.__iXom) {\n if(b.__iAbs) {\n return -1;\n }\n }\n return a.__iIndex - b.__iIndex;\n });\n return zIndex;\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 static isValid(s) {\n return TAG_NAME.hasOwnProperty(s);\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from '../util/mode';\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 draw from '../util/draw';\nimport level from '../animate/level';\n\nconst { AUTO } = unit;\nconst { genCanvasPolygon, genSvgPolygon } = draw;\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 // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\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 }\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.__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 let { width: w, height: h } = this.root;\n let c = inject.getCacheCanvas(w, h);\n c.ctx.drawImage(source, originX, originY, width, height);\n c.ctx.globalCompositeOperation = 'destination-in';\n c.ctx.fillStyle = '#FFF';\n genCanvasPolygon(ctx, list);\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, w, h);\n c.draw(c.ctx);\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\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 = genSvgPolygon(list);\n let maskId = defs.add({\n tagName: 'mask',\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.conMask = 'url(#' + maskId + ')';\n }\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n props.push(['transform', 'matrix(' + util.joinArr(matrix, ',') + ')']);\n }\n this.virtualDom.children.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n }\n }\n }\n else {\n let loadImg = this.__loadImg;\n loadImg.url = src;\n loadImg.source = null;\n loadImg.error = null;\n inject.measureImg(src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.url && !this.__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 } } = this;\n root.delRefreshTask(loadImg.cb);\n root.delRefreshTask(this.__task);\n if(width.unit !== AUTO && height.unit !== AUTO) {\n root.addRefreshTask(loadImg.cb);\n }\n else {\n root.addRefreshTask(this.__task = {\n before() {\n root.setRefreshLevel(level.REFLOW);\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","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.bbMask, nvd.bbMask);\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, filter, conMask } = 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 // geom不会有mask,对比一直相等\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\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.conMask !== conMask) {\n if(conMask) {\n elem.childNodes[1].setAttribute('mask', conMask);\n }\n else {\n elem.childNodes[1].removeAttribute('mask');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n diffX2X(elem, ovd, nvd);\n if(!root) {\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbMask, nvd.bbMask);\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.bbMask, nvd.bbMask);\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 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 diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbMask, nvd.bbMask);\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, oMask, nMask) {\n let ol = obb.length;\n let nl = nbb.length;\n if(oMask !== nMask) {\n if(!nMask) {\n elem.removeAttribute('mask');\n }\n else {\n elem.setAttribute('mask', nMask);\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 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","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/util';\n\nconst { isNil, isFunction } = util;\n\nconst LIST = [\n 'playbackRate',\n 'iterations',\n 'fps',\n 'spfLimit',\n 'delay',\n 'endDelay',\n 'duration',\n 'direction',\n 'fill',\n 'playCount',\n 'currentTime',\n 'easing',\n];\n\nfunction replaceOption(target, globalValue, key, vars) {\n // 优先vars,其次总控,都没有忽略即自己原本声明\n if(!isNil(globalValue)) {\n let decl = target['var-' + key];\n if(!decl) {\n target[key] = globalValue;\n }\n else {\n let id = decl.id;\n if(!id || !vars[id]) {\n target[key] = globalValue;\n }\n }\n }\n}\n\nfunction replaceGlobal(global, options) {\n LIST.forEach(k => {\n if(global.hasOwnProperty(k)) {\n replaceOption(options, global[k], k, global.vars);\n }\n });\n}\n\nclass Controller {\n constructor() {\n this.__records = [];\n this.__list = [];\n }\n\n __op(options) {\n this.records.forEach(record => {\n let { animate } = record;\n if(Array.isArray(animate)) {\n animate.forEach(item => {\n // 用总控替换动画属性中的值,注意vars优先级\n replaceGlobal(options, item.options);\n });\n }\n else {\n replaceGlobal(options, animate.options);\n }\n });\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.__list = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init() {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n let records = this.records;\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.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 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 records() {\n return this.__records;\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 '../node/Dom';\nimport util from '../util/util';\nimport mode from '../util/mode';\nimport diff from '../util/diff';\nimport Defs from './Defs';\nimport unit from '../style/unit';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport level from '../animate/level';\nimport Controller from '../animate/Controller';\n\nconst { isNil, isObject, isFunction } = util;\n\nconst { PX } = unit;\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(node) {\n ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(type => {\n node.addEventListener(type, e => {\n node.__root.__cb(e, ['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1);\n });\n });\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props, children);\n this.__node = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n this.__task = [];\n this.__ref = {};\n this.__animateController = new Controller();\n this.__init(this, this);\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 }\n\n __genHtml() {\n let res = `<${this.tagName}`;\n // 拼接处理属性\n for(let i = 0, len = this.__props.length; i < len; i++) {\n let item = this.__props[i];\n let [k, v] = item;\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n }\n res += `>`;\n return res;\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接强制响应\n __cb(e, force) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { node } = this;\n let { x: x2, y: y2, left, top, width, height } = node.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 let sx = width / this.width;\n let sy = height / this.height;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标\n if(sx !== 1) {\n x /= sx;\n }\n if(sy !== 1) {\n y /= sy;\n }\n }\n let data = {\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 this.__emitEvent(data, force);\n return data;\n }\n\n appendTo(dom) {\n dom = getDom(dom);\n this.__initProps();\n this.__refreshLevel = level.REFLOW;\n // 已有root节点\n if(dom.nodeName.toUpperCase() === this.tagName.toUpperCase()) {\n this.__node = 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.__node = dom.querySelector(this.tagName);\n if(!this.__node) {\n dom.innerHTML = this.__genHtml();\n this.__node = dom.querySelector(this.tagName);\n }\n }\n this.__uuid = isNil(this.__node.__uuid) ? uuid++ : this.__node.__uuid;\n this.__defs = this.node.__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.__node.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n this.refresh();\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.node.__root) {\n this.node.__root.__destroy();\n }\n else {\n initEvent(this.node);\n this.node.__uuid = this.__uuid;\n }\n this.node.__root = this;\n }\n\n refresh(cb) {\n let { isDestroyed, renderMode, ctx, defs, style } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(style.display) === -1) {\n style.display = 'block';\n }\n // 同理position不能为absolute\n if(style.position === 'absolute') {\n style.position = 'static';\n }\n // 根节点满宽高\n style.width = {\n value: this.width,\n unit: PX,\n };\n style.height = {\n value: this.height,\n unit: PX,\n };\n // 计算css继承,获取所有字体和大小并准备测量文字\n let lv = this.__refreshLevel;\n this.__refreshLevel = level.REPAINT;\n if(lv === level.REFLOW) {\n this.__measure(renderMode, ctx, true);\n }\n inject.measureText(() => {\n // 第一次默认REFLOW以及动画设计变更等需要布局\n if(lv === level.REFLOW) {\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: this.width,\n h: this.height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: this.width,\n h: this.height,\n });\n }\n // 没发生REFLOW只需要计算继承\n else {\n this.__repaint(true);\n }\n if(renderMode === mode.CANVAS) {\n this.__clear();\n }\n this.render(renderMode, ctx, defs);\n if(renderMode === mode.SVG) {\n let nvd = this.virtualDom;\n let nd = defs;\n nvd.defs = nd.value;\n if(this.node.__root) {\n diff(this.node, this.node.__vd, nvd);\n }\n else {\n this.node.innerHTML = util.joinVirtualDom(nvd);\n }\n this.node.__vd = nvd;\n this.node.__defs = nd;\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH, lv);\n });\n }\n\n addRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task } = 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 clone.forEach(item => {\n if(isObject(item) && isFunction(item.before)) {\n item.before(diff);\n }\n });\n this.refresh();\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 }\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 setRefreshLevel(lv) {\n if(lv > this.__refreshLevel) {\n this.__refreshLevel = lv;\n }\n }\n\n __frameHook() {\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\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() {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n this.__ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.__ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n\n get node() {\n return this.__node;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\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 '../util/mode';\nimport util from '../util/util';\nimport matrix from '../math/matrix';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { clone, int2rgba, isNil, extend, joinArr } = util;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMask = !!this.props.mask;\n this.__currentProps = this.props;\n let { style, isMask } = this;\n if(isMask) {\n style.visibility = 'visible';\n style.background = null;\n style.border = null;\n style.strokeWidth = 0;\n style.stroke = null;\n }\n css.normalize(this.style, reset.dom.concat(reset.geom));\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 }\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 }\n\n __preRender(renderMode, ctx, defs) {\n let { sx: x, sy: y, width, height, currentStyle, computedStyle } = this;\n let {\n strokeWidth,\n fill,\n stroke,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = currentStyle;\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 if(strokeWidth.unit === PX) {\n strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n strokeWidth = 0;\n }\n computedStyle.strokeWidth = strokeWidth;\n computedStyle.stroke = stroke;\n if(stroke && (stroke.k === 'linear' || stroke.k === 'radial')) {\n stroke = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, stroke);\n }\n else {\n stroke = int2rgba(stroke);\n }\n computedStyle.fill = fill;\n if(fill && (fill.k === 'linear' || fill.k === 'radial')) {\n fill = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, fill);\n }\n else {\n fill = int2rgba(fill);\n }\n computedStyle.strokeWidth = strokeWidth;\n computedStyle.strokeDasharray = strokeDasharray;\n computedStyle.strokeLinecap = strokeLinecap;\n return {\n x,\n y,\n originX,\n originY,\n cx,\n cy,\n display,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr: util.joinArr(strokeDasharray, ','),\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 this.virtualDom.type = 'geom';\n }\n let { isDestroyed, animateProps, computedStyle: { display } } = this;\n this.__currentProps = animateProps;\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) {\n // mask渲染在canvas等被遮罩层调用,svg生成maskId\n if(renderMode === mode.SVG) {\n this.render(renderMode, ctx, defs);\n let vd = this.virtualDom;\n vd.isMask = true;\n // svg的mask没有transform,需手动计算变换后的坐标应用\n let children = clone(vd.children);\n let m = this.matrixEvent;\n children.forEach(child => {\n let xi = 0;\n let yi = 1;\n let x, y;\n let props = child.props;\n if(child.tagName === 'rect') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'x') {\n xi = i;\n x = v;\n }\n else if(k === 'y') {\n yi = i;\n y = v;\n }\n }\n let point = matrix.calPoint([x, y], m);\n props[xi][1] = point[0];\n props[yi][1] = point[1];\n }\n else if(child.tagName === 'circle' || child.tagName === 'ellipse') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'cx') {\n xi = i;\n x = v;\n }\n else if(k === 'cy') {\n yi = i;\n y = v;\n }\n }\n let point = matrix.calPoint([x, y], m);\n props[xi][1] = point[0];\n props[yi][1] = point[1];\n }\n else if(child.tagName === 'polyline') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'points') {\n props[i][1] = v.replace(/([\\d.]+),([\\d.]+)/g, ($0, $1, $2) => {\n return joinArr(matrix.calPoint([$1, $2], m), ',');\n });\n break;\n }\n }\n }\n else if(child.tagName === 'path') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'd') {\n props[i][1] = v.replace(/([\\d.]+),([\\d.]+)/g, ($0, $1, $2) => {\n return joinArr(matrix.calPoint([$1, $2], m), ',');\n });\n break;\n }\n }\n }\n });\n // 连续多个mask需要合并\n let { prev } = this;\n if(prev && prev.isMask) {\n let last = defs.value;\n last = last[last.length - 1];\n last.children = last.children.concat(children);\n this.__maskId = prev.maskId;\n return;\n }\n let maskId = defs.add({\n tagName: 'mask',\n props: [],\n children,\n });\n this.__maskId = 'url(#' + maskId + ')';\n }\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 isMask() {\n return this.__isMask;\n }\n\n get maskId() {\n return this.__maskId;\n }\n\n get animateProps() {\n let { props, animationList } = this;\n let copy;\n animationList.forEach(item => {\n if(item.animating) {\n if(!copy) {\n copy = extend({}, props);\n }\n extend(copy, item.props, item.keys);\n }\n });\n return copy || props;\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 '../util/mode';\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n this.__x1 = this.__y1 = 0;\n this.__x2 = this.__y2 = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(this.props.x1 !== undefined) {\n this.__x1 = parseFloat(this.props.x1) || 0;\n }\n if(this.props.y1 !== undefined) {\n this.__y1 = parseFloat(this.props.y1) || 0;\n }\n if(this.props.x2 !== undefined) {\n this.__x2 = parseFloat(this.props.x2) || 0;\n }\n if(this.props.y2 !== undefined) {\n this.__y2 = parseFloat(this.props.y2) || 0;\n }\n if(Array.isArray(this.props.controlA)) {\n this.__controlA = this.props.controlA;\n }\n if(Array.isArray(this.props.controlB)) {\n this.__controlB = this.props.controlB;\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n display,\n visibility,\n originX,\n originY,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, x1, y1, x2, y2, controlA, controlB } = this;\n x1 = originX + x1 * width;\n y1 = originY + y1 * height;\n x2 = originX + x2 * width;\n y2 = originY + y2 * height;\n let curve = 0;\n // 控制点,曲线\n let cx1, cy1, cx2, cy2;\n if(controlA.length === 2) {\n curve++;\n cx1 = originX + controlA[0] * width;\n cy1 = originY + controlA[1] * height;\n }\n if(controlB.length === 2) {\n curve += 2;\n cx2 = originX + controlB[0] * width;\n cy2 = originY + controlB[1] * height;\n }\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n if(curve === 3) {\n ctx.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);\n }\n else if(curve === 2) {\n ctx.quadraticCurveTo(cx2, cy2, x2, y2);\n }\n else if(curve === 1) {\n ctx.quadraticCurveTo(cx1, cy1, x2, y2);\n }\n else {\n ctx.lineTo(x2, y2);\n }\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d;\n if(curve === 3) {\n d = 'M' + x1 + ',' + y1 + ' C' + cx1 + ',' + cy1 + ' ' + cx2 + ',' + cy2 + ' ' + x2 + ',' + y2;\n }\n else if(curve === 2) {\n d = 'M' + x1 + ',' + y1 + ' Q' + cx2 + ',' + cy2 + ' ' + x2 + ',' + y2;\n }\n else if(curve === 1) {\n d = 'M' + x1 + ',' + y1 + ' Q' + cx1 + ',' + cy1 + ' ' + x2 + ',' + y2;\n }\n else {\n d = 'M' + x1 + ',' + y1 + ' L' + x2 + ',' + y2;\n }\n let props = [\n ['d', d],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 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 '../util/mode';\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n this.__points = [];\n if(Array.isArray(this.props.points)) {\n this.__points = this.props.points;\n }\n // 控制点\n this.__controls = [];\n if(Array.isArray(this.props.controls)) {\n this.__controls = this.props.controls;\n }\n }\n\n __getPoints(originX, originY, width, height, points, controls) {\n let pts = [];\n let cls = [];\n let hasControl = false;\n points.forEach(item => {\n pts.push([\n originX + item[0] * width,\n originY + item[1] * height\n ]);\n });\n controls.forEach(item => {\n if(Array.isArray(item) && (item.length === 2 || item.length === 4)) {\n let arr = [];\n item.forEach((item2, i) => {\n if(i === 0 || i === 2) {\n arr.push(originX + item[i] * width);\n }\n else {\n arr.push(originY + item[i] * height);\n }\n });\n cls.push(arr);\n hasControl = true;\n }\n else {\n cls.push(null);\n }\n });\n return [pts, cls, hasControl];\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, points, controls } = this;\n let [pts, cls, hasControl] = this.__getPoints(originX, originY, width, height, points, controls);\n if(points.length < 2) {\n console.error('Points must have at lease 2 item: ' + points);\n return;\n }\n for(let i = 0, len = points.length; i < len; i++) {\n if(!Array.isArray(points[i]) || points[i].length < 2) {\n console.error('Each Point must have a coords: ' + points[i]);\n return;\n }\n }\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\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 let cl = cls[i - 1];\n if(!cl || !cl.length) {\n ctx.lineTo(point[0], point[1]);\n }\n else if(cl.length === 4) {\n ctx.bezierCurveTo(cl[0], cl[1], cl[2], cl[3], point[0], point[1]);\n }\n else {\n ctx.quadraticCurveTo(cl[0], cl[1], point[0], point[1]);\n }\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 ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n let tagName;\n if(hasControl) {\n let s = 'M' + pts[0][0] + ',' + pts[0][1];\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n let cl = cls[i - 1];\n if(!cl || !cl.length) {\n s += 'L' + point[0] + ',' + point[1];\n }\n else if(cl.length === 4) {\n s += 'C' + cl[0] + ',' + cl[1] + ' ' + cl[2] + ',' + cl[3] + ' ' + point[0] + ',' + point[1];\n }\n else {\n s += 'Q' + cl[0] + ',' + cl[1] + ' ' + point[0] + ',' + point[1];\n }\n }\n props.push(['d', s]);\n tagName = 'path';\n }\n else {\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 props.push(['points', s]);\n tagName = 'polyline';\n }\n if(strokeDasharray.length) {\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 this.addGeom(tagName, 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, controls) {\n let [pts, cls, hasControl] = super.__getPoints(originX, originY, width, height, points, controls);\n pts.push(pts[0]);\n return [pts, cls, hasControl];\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport mode from '../util/mode';\n\nconst OFFSET = Math.PI * 0.5;\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\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n this.__begin = 0;\n this.__end = 0;\n if(this.props.begin) {\n this.__begin = parseFloat(this.props.begin);\n if(isNaN(this.begin)) {\n this.__begin = 0;\n }\n }\n if(this.props.end) {\n this.__end = parseFloat(this.props.end);\n if(isNaN(this.end)) {\n this.__end = 0;\n }\n }\n // 半径0~1,默认1\n this.__r = 1;\n if(this.props.r) {\n this.__r = parseFloat(this.props.r);\n if(isNaN(this.r)) {\n this.__r = 1;\n }\n }\n // 扇形两侧是否有边\n this.__edge = false;\n if(this.props.edge !== undefined) {\n this.__edge = !!this.props.edge;\n }\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(this.props.closure !== undefined) {\n this.__closure = !!this.props.closure;\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, begin, end, r, edge, closure } = this;\n if(begin === end) {\n return;\n }\n r *= Math.min(width, height) * 0.5;\n let x1, y1, x2, y2;\n [ x1, y1 ] = getCoordsByDegree(cx, cy, r, begin);\n [ x2, y2 ] = getCoordsByDegree(cx, cy, r, end);\n let large = (end - begin) > 180 ? 1 : 0;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\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 ctx.lineTo(x1, y1);\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 ctx.lineTo(x1, y1);\n }\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(edge) {\n let props = [\n ['d', closure\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 ],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', closure\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 ],\n ['fill', fill]\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', 'M' + x1 + ',' + y1 + ' A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2],\n ['fill', 'rgba(0,0,0,0)'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('path', props);\n }\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 '../util/mode';\nimport geom from '../math/geom';\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n this.__rx = 0;\n if(this.props.rx) {\n this.__rx = parseFloat(this.props.rx);\n if(isNaN(this.rx)) {\n this.__rx = 0;\n }\n }\n this.__ry = 0;\n if(this.props.ry) {\n this.__ry = parseFloat(this.props.ry);\n if(isNaN(this.ry)) {\n this.__ry = 0;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, rx, ry } = this;\n rx = Math.min(rx, 0.5);\n ry = Math.min(ry, 0.5);\n rx *= width;\n ry *= height;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n if(rx === 0 && ry === 0) {\n ctx.rect(originX, originY, width, height);\n }\n else {\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n ctx.moveTo(originX + rx, originY);\n ctx.lineTo(originX + width - rx, originY);\n ctx.bezierCurveTo(originX + width + ox - rx, originY, originX + width, originY + ry - oy, originX + width, originY + ry);\n ctx.lineTo(originX + width, originY + height - ry);\n ctx.bezierCurveTo(originX + width, originY + height + oy - ry, originX + width + ox - rx, originY + height, originX + width - rx, originY + height);\n ctx.lineTo(originX + rx, originY + height);\n ctx.bezierCurveTo(originX + rx - ox, originY + height, originX, originY + height + oy - ry, originX, originY + height - ry);\n ctx.lineTo(originX, originY + ry);\n ctx.bezierCurveTo(originX, originY + ry - oy, originX + rx - ox, originY, originX + rx, originY);\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 ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(rx) {\n props.push(['rx', rx]);\n }\n if(ry) {\n props.push(['ry', ry]);\n }\n if(strokeDasharray.length) {\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 this.addGeom('rect', 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 '../util/mode';\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n this.__r = 1;\n if(this.props.r) {\n this.__r = parseFloat(this.props.r);\n if(isNaN(this.r)) {\n this.__r = 1;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, r } = this;\n r *= Math.min(width, height) * 0.5;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, 2 * Math.PI);\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 ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('circle', 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 '../util/mode';\nimport geom from '../math/geom';\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n this.__rx = 1;\n if(this.props.rx) {\n this.__rx = parseFloat(this.props.rx);\n if(isNaN(this.rx)) {\n this.__rx = 1;\n }\n }\n this.__ry = 1;\n if(this.props.ry) {\n this.__ry = parseFloat(this.props.ry);\n if(isNaN(this.ry)) {\n this.__ry = 1;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, rx, ry } = this;\n rx *= width * 0.5;\n ry *= height * 0.5;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n if(ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, 0, 0, 2 * Math.PI);\n }\n else {\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n ctx.moveTo(cx - rx, cy);\n ctx.bezierCurveTo(cx - rx, cy - oy, cx - ox, cy - ry, cx, cy - ry);\n ctx.bezierCurveTo(cx + ox, cy - ry, cx + rx, cy - oy, cx + rx, cy);\n ctx.bezierCurveTo(cx + rx, cy + oy, cx + ox, cy + ry, cx, cy + ry);\n ctx.bezierCurveTo(cx - ox, cy + ry, cx - rx, cy + oy, cx - rx, cy);\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 ['cx', cx],\n ['cy', cy],\n ['rx', rx],\n ['ry', ry],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('ellipse', 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};\n\nlet abbrCssProperty = {\n os: 'offset',\n e: 'easing',\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.concat(reset.geom).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 util from './util';\nimport abbr from './abbr';\nimport Node from '../node/Node';\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 let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值\n if(v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isNil(v)) {\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 id: ' + libraryId);\n }\n }\n });\n }\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + id);\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 = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + 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 => {\n return parse(karas, item, animateRecords, vars, hash);\n }));\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 Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport mode from './util/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 parse from './util/parse';\nimport inject from './util/inject';\nimport abbr from './util/abbr';\nimport css from './style/css';\nimport unit from './style/unit';\nimport reset from './style/reset';\nimport frame from './animate/frame';\nimport easing from './animate/easing';\nimport level from './animate/level';\nimport math from './math/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 createVd(tagName, props, children) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(Dom.isValid(tagName)) {\n if(tagName === 'img') {\n return new Img(tagName, props);\n }\n return new Dom(tagName, props, children);\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n let klass = Geom.getRegister(tagName);\n return new klass(tagName, props);\n },\n createCp(cp, props, children) {\n return new cp(props, children);\n },\n parse(json, dom, options = {}) {\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(this, 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 = vd.animateController;\n ac.__records = animateRecords;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n this.render(vd, dom);\n // 总控次数、速度\n ac.__op(options);\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(!options.hasOwnProperty('autoPlay') || options.autoPlay) {\n ac.play();\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = animateRecords;\n }\n }\n return vd;\n },\n Root,\n Dom,\n Img,\n Geom,\n mode,\n Component,\n Event,\n util,\n inject,\n css,\n unit,\n reset,\n abbr,\n frame,\n easing,\n level,\n math,\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","toString","isType","type","obj","call","joinSourceArray","arr","res","i","len","length","item","Array","isArray","stringify","s","isNil","encodeHtml","prop","replace","v","undefined","joinVirtualDom","vd","defs","forEach","joinDef","bbMask","bb","joinVd","conMask","children","isMask","props","tagName","content","opacity","transform","mask","filter","def","uuid","joinItem","rgba2int","color","charAt","slice","push","parseInt","c","match","parseFloat","int2rgba","joinArr","arr2hash","hash","list","Object","keys","j","k","hash2arr","clone","util","isDate","Date","n","equalArr","a","b","ai","bi","isArrayA","isArrayB","extend","target","source","split","isObject","isString","isFunction","isNumber","isBoolean","isPrimitive","init","root","host","ref","CANVAS","SVG","DOM","position","display","top","right","bottom","left","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","width","height","flexGrow","flexShrink","flexBasis","flexDirection","justifyContent","alignItems","textAlign","transformOrigin","visibility","zIndex","translateX","translateY","scaleX","scaleY","skewX","skewY","rotateZ","GEOM","fill","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","dom","domKey","geom","geomKey","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","identity","multiply","calPoint","point","m","vectorProduct","x1","y1","x2","y2","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","Math","max","min","transformPoint","matrix","d","e","f","angleBySide","theta","pow","acos","pointsDistance","sqrt","triangleIncentre","x3","y3","d2r","PI","r2d","H","h","deg","cos","sin","calDeg","dx","dy","atan","abs","rotate","t","pointIndex","points","index","cross","pointByIndex","exchangeOrder","sx1","sy1","sx2","sy2","sx3","sy3","tx1","ty1","tx2","ty2","tx3","ty3","isOverflow","cross1","cross2","ls","lt","scale","alpha","ax1","ay1","ax2","ay2","ax3","ay3","ab","ac","bc","AB","AC","BC","A","tan","tar","unit","math","calSingle","calMatrix","ow","oh","normalize","calMatrixByOrigin","t2","calMatrixWithOrigin","pointInQuadrilateral","x4","y4","normalizeSingle","value","calOrigin","w","tfo","gradient","img","getLinearDeg","exec","getRadialPosition","data","test","center","getColorStop","p","start","end","num","per","prev","splice","allBefore","allAfter","first","last","getCsLimit","next","c1","c2","getCsStartLimit","getCsEndLimit","calLinearCoords","cx","cy","x0","y0","r","calRadialRadius","shape","size","iw","ih","xl","yl","p1","p2","r1","g1","b1","a1","r2","g2","b2","a2","l1","l2","floor","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","controls1","controls2","calBezierTopLeft","concat","pop","endLength","oyr","calBezierTopRight","sx","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","xa","xb","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","DEFAULT_FONT_SIZE","parserOneBorder","parseFlex","grow","shrink","basis","parseMarginPadding","key","temp","calUnit","compatibleTransform","reset","border","borderColor","borderRadius","background","gd","repeat","bgc","backgroundPosition","flex","console","error","hasOwnProperty","translate","skew","arr1","arr2","isNaN","blur","compute","node","isRoot","animateStyle","currentStyle","__currentStyle","computedStyle","__computedStyle","parentComputedStyle","parent","calNormalLineHeight","repaint","setFontStyle","getBaseLine","normal","font","calRelativePercent","calRelative","isWidth","calAbsolute","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","LineBox","__content","renderMode","ctx","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","begin","count","maxW","lineBox","__offsetX","__offsetY","render","textWidth","__layout","fillStyle","virtualDom","baseLine","Event","__eHash","id","handle","self","on","cb","apply","off","__karasEventCb","once","emit","event","fns","fn","REPAINT","REFLOW","controlA","controlB","rx","ry","controls","STYLE","Component","constructor","__tagName","__props","__children","__ref","__state","__isMount","state","delRefreshTask","__task","ovd","shadowRoot","before","__init","setRefreshLevel","level","after","__destroy","addRefreshTask","sr","listener","__shadowRoot","tool","__create","componentWillUnmount","force","__emitEvent","componentDidMount","REFRESH","__measure","__repaint","defineProperty","prototype","get","arguments","SPF","cacheCanvas","document","createElement","body","append","setAttribute","canvas","getContext","draw","IMG","INIT","LOADING","LOADED","inject","html","chars","inline","div","appendChild","innerHTML","cns","childNodes","window","getComputedStyle","text","__measureCb","removeChild","measureImg","url","task","Image","onload","success","onerror","substr","location","hostname","crossOrigin","src","warn","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","clearTimeout","now","performance","getCacheCanvas","getMaskCanvas","isDom","Element","getElementsByTagName","traversal","step","Frame","__hookTask","__now","__karasFramecb","offFrame","onFrame","__aTask","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","Float32Array","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","linear","easeIn","easeOut","ease","easeInOut","cubicBezier","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","radial","KEY_EXPAND","EXPAND_HASH","unify","frames","currentProps","inherit","outerWidth","outerHeight","tf","equalStyle","av","bv","isStyleReflow","calRefresh","frameStyle","lastStyle","lv","genBeforeRefresh","animation","__frameHook","__style","framing","duration","es","offset","time","transition","calDiff","pm","nm","pi","ni","pv","nv","innerWidth","eq","pp","np","len2","calFrame","ts","binarySearch","frame","middle","getEasing","ea","timingFunction","steps","stepsD","percent","ceil","calIntermediateStyle","st","gotoOverload","options","Animation","__id","__target","__list","nl","__options","op","__duration","delay","endDelay","iterations","fps","playbackRate","__easing","playCount","spfLimit","__frames","__framesR","__startTime","currentTime","__nextTime","__fpsTime","__playState","current","unshift","copy","__keys","framesR","reverse","__clean","isFinish","__cancelTask","__currentTime","__playCount","__stayEnd","__fin","__begin","__end","__isDelay","__finish","__inFps","__enterFrame","FINISH","__frameCb","isDelay","FRAME","__firstPlay","PLAY","__playCb","playState","firstEnter","stayEnd","stayBegin","__stayBegin","enterFrame","__calDiffTime","needRefresh","currentFrames","alternate","isEven","isLastFrame","isLastCount","inEndDelay","__nextBegin","BEGIN","END","pending","PAUSE","play","nextFrame","CANCEL","__goto","isFrame","excludeDelay","finish","spf","animateController","add","remove","backwards","both","forwards","removeControl","__delay","__endDelay","__fps","__iterations","Infinity","__fill","__direction","__playbackRate","__spfLimit","genCanvasPolygon","beginPath","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","closePath","genSvgPolygon","renderBorder","xom","renderBgc","rect","borderRadiusKs","calBorderRadius","noRadius","half","calBackgroundSize","calBackgroundPosition","container","Xom","__listener","__animationList","__loadBgi","__mpWidth","mp","fromAbs","__mp","__layoutBlock","__layoutFlex","__layoutInline","ar","__animateRecords","__records","records","w2","h2","fixedWidth","fixedHeight","innerHeight","sy","globalAlpha","__matrix","isScale","renderMatrix","matrixEvent","mx","__matrixEvent","setTransform","loadBgi","bgX","bgY","needMask","xnl","xnr","ynt","ynb","currentCtx","drawImage","globalCompositeOperation","clearRect","image","needResize","maskId","bgi","__gradient","hasMask","owner","animationList","__stopPropagation","isGeom","zIndexChildren","childWillResponse","child","__touchstartTarget","__stopImmediatePropagation","willResponseEvent","__hasEmitted","inThis","vs","__getLg","__getRg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","underControl","autoPlay","cancel","animating","LineGroup","__calBaseLine","TAG_NAME","INLINE","isRelativeOrAbsolute","flatten","traverse","lastText","Dom","__lineGroups","block","none","flowChildren","__tryLayInline","isDirectionRow","isRecursion","main","__calAutoBasis","min2","max2","__calMp","lineGroups","__preLayout","cw","lineGroup","fw","verticalAlign","horizonAlign","__marginAuto","maxX","growList","shrinkList","basisList","minList","growSum","shrinkSum","basisSum","maxSum","maxCross","overflow","between","around","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__layoutAbs","__renderAsMask","__renderByMask","noAbs","__iIndex","isXom","__iXom","isAbs","__iAbs","sort","Img","loadImg","__loadImg","originX","originY","pts","strokeStyle","lineWidth","arc","__addGeom","elem","nvd","diffDefs","diffBb","diffD2D","od","nd","ol","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffChild","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","firstChild","lastChild","obb","nbb","oMask","nMask","isText","svg","where","insertBefore","Defs","LIST","replaceOption","globalValue","vars","decl","replaceGlobal","global","Controller","record","animate","args","__action","__set","getDom","querySelector","renderProp","initEvent","addEventListener","__cb","Root","__node","__mw","__mh","__animateController","mix","getBoundingClientRect","touches","pageX","pageY","stopPropagation","stopImmediatePropagation","preventDefault","__initProps","__refreshLevel","nodeName","toUpperCase","__genHtml","__uuid","__defs","getInstance","getPropertyValue","__ctx","__renderMode","refresh","clear","__clear","__vd","__rTask","hookTask","REGISTER","Geom","__isMask","__currentProps","strokeDasharrayStr","animateProps","__preRender","xi","yi","$0","$1","$2","__maskId","name","hasRegister","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","curve","lineCap","lineJoin","miterLimit","setLineDash","addGeom","getProps","Polyline","__points","__controls","cls","hasControl","item2","__getPoints","cl","Polygon","OFFSET","getCoordsByDegree","Sector","__r","__edge","edge","__closure","closure","large","Rect","__rx","__ry","Circle","Ellipse","ellipse","fullCssProperty","abbrCssProperty","os","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr","abbr2full","k2","fk","replaceVars","join","linkLibrary","libraryId","libraryItem","linkChild","parse","karas","json","animateRecords","library","createGm","createVd","animationRecord","has","register","version","appendTo","isValid","klass","getRegister","createCp","cp","__op"],"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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AAC+iB,KAAP,GAAeA,KAAf;EACD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["src/node/Node.js","src/util/util.js","src/node/tool.js","src/util/mode.js","src/style/reset.js","src/style/unit.js","src/math/matrix.js","src/math/geom.js","src/math/tar.js","src/math/index.js","src/style/transform.js","src/style/reg.js","src/style/gradient.js","src/style/border.js","src/style/font.js","src/style/css.js","src/style/image.js","src/node/LineBox.js","src/node/Text.js","src/util/Event.js","src/animate/level.js","src/animate/repaint.js","src/node/Component.js","src/util/inject.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/util/draw.js","src/node/Xom.js","src/node/LineGroup.js","src/node/Dom.js","src/node/Img.js","src/util/diff.js","src/node/Defs.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/util/abbr.js","src/util/parse.js","src/index.js"],"sourcesContent":["class Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative/margin:auto/text-align等造成的偏移量\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","let toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\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) {\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) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, mask, filter } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask') {\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 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\nfunction equalArr(a, b) {\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 if(ai !== bi) {\n return false;\n }\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 = keys.length;\n while(i--) {\n let k = keys[i];\n target[k] = source[k];\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\nlet util = {\n isObject: isType('Object'),\n isString: isType('String'),\n isFunction: isType('Function'),\n isNumber: isType('Number'),\n isBoolean: isType('Boolean'),\n isDate: isType('Date'),\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\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 extend,\n joinArr,\n};\n\nexport default util;\n","import util from '../util/util';\n\nfunction init(target, root, host) {\n let ref = target.props.ref;\n if(util.isString(ref) && ref) {\n root.ref[ref] = target;\n }\n else if(util.isFunction(ref)) {\n ref(target);\n }\n target.__root = root;\n target.__host = host;\n}\n\nexport default {\n init,\n};\n","export default {\n CANVAS: 0,\n SVG: 1,\n};\n","import util from '../util/util';\n\nconst 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};\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 = [];\nlet domKey = [];\nObject.keys(DOM).forEach(k => {\n domKey.push(k);\n let v = DOM[k];\n dom.push({\n k,\n v,\n });\n});\n\nlet geom = [];\nlet geomKey = [];\nObject.keys(GEOM).forEach(k => {\n geomKey.push(k);\n let v = GEOM[k];\n geom.push({\n k,\n v,\n });\n});\n\nexport default {\n DOM,\n GEOM,\n domKey,\n geomKey,\n dom,\n geom,\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","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n// 矩阵a*b,固定两个matrix都是长度6\nfunction multiply(a, b) {\n return [\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 a[0] * b[4] + a[2] * b[5] + a[4],\n a[1] * b[4] + a[3] * b[5] + a[5]\n ];\n}\n\nfunction calPoint(point, m) {\n let [x, y] = point;\n return [\n m[0] * x + m[2] * y + m[4],\n m[1] * x + m[3] * y + m[5],\n ];\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\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\nfunction transformPoint(matrix, x, y) {\n let [a, b, c, d, e, f] = matrix;\n return [a * x + c * y + e, b * x + d * y + f];\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\nexport default {\n vectorProduct,\n pointInPolygon,\n transformPoint,\n d2r(n) {\n return n * Math.PI / 180;\n },\n r2d(n) {\n return n * 180 / Math.PI;\n },\n // 贝塞尔曲线模拟1/4圆弧比例\n H: 4 * (Math.sqrt(2) - 1) / 3,\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};\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 // 第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为基准,缩放ab至目标相同长度\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 ls = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n lt = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n if(ls !== lt) {\n let scale = lt / ls;\n t = matrix.identity();\n t[3] = scale;\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 // 第5步,再次旋转,角度为目标旋转到x轴的负值\n if(alpha !== 0) {\n t = rotate(alpha);\n m = matrix.multiply(t, m);\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","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 { d2r, transformPoint } = 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 = matrix.identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = matrix.identity();\n calSingle(t, k, v);\n m = matrix.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 = matrix.identity();\n t[4] = ox;\n t[5] = oy;\n let res = matrix.multiply(t, m);\n let t2 = matrix.identity();\n t2[4] = -ox;\n t2[5] = -oy;\n res = matrix.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] = transformPoint(matrix, x1, y1);\n [x2, y2] = transformPoint(matrix, x2, y2);\n [x4, y4] = transformPoint(matrix, x4, y4);\n [x3, y3] = transformPoint(matrix, x3, y3);\n return geom.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 - (main2 - y1) * Math.tan(deg1);\n cross2 = x4 - (main1 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main2],\n [cross2, main1],\n [x4, main1],\n [x4, 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 - (main1 - x1) * Math.tan(deg2);\n cross2 = y4 - (main2 - x1) * 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 - x1) * 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 - x1) * 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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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 endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\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 if(needInner) {\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\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","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport util from '../util/util';\n\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING } = unit;\nconst { isNil, rgba2int } = util;\n\nconst DEFAULT_FONT_SIZE = 16;\n\nfunction parserOneBorder(style, direction) {\n let k = 'border' + direction;\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\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis;\n }\n}\n\nfunction parseMarginPadding(style, key) {\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 ['Top', 'Right', 'Bottom', 'Left'].forEach((k, i) => {\n k = key + k;\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n delete style[key];\n }\n}\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$/.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PX,\n };\n }\n else if(/deg$/.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 标准化的样式\n */\nfunction normalize(style, reset = []) {\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n if(isNil(style[k])) {\n style[k] = temp;\n }\n });\n delete style.border;\n }\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n parserOneBorder(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Width';\n if(isNil(style[k])) {\n // width后面会统一格式化处理\n style[k] = temp;\n }\n });\n delete style.borderWidth;\n }\n temp = style.borderColor;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n if(isNil(style[k])) {\n style[k] = rgba2int(temp);\n }\n });\n delete style.borderColor;\n }\n temp = style.borderStyle;\n if(temp) {\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Style';\n if(isNil(style[k])) {\n style[k] = temp;\n }\n });\n delete style.borderStyle;\n }\n temp = style.borderRadius;\n if(temp) {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n temp = temp.toString().split('/');\n if(temp.length === 1) {\n temp[1] = temp[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = temp[i].toString().split(/\\s+/);\n if(item.length === 0) {\n temp[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n temp[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n temp[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n temp[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n temp[i] = item.slice(0, 4);\n }\n }\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach((k, i) => {\n k = 'border' + k + 'Radius';\n if(isNil(style[k])) {\n style[k] = temp[0][i] + ' ' + temp[1][i];\n }\n });\n delete style.borderRadius;\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n // gradient/image和颜色可以并存\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(temp);\n if(gd) {\n style.backgroundImage = gd[0];\n temp = temp.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(temp);\n if(img) {\n style.backgroundImage = img[0];\n temp = temp.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-)?repeat(-[xy])?/i.exec(temp);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\))/i.exec(temp);\n if(bgc) {\n style.backgroundColor = bgc[0];\n temp = temp.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = temp.match(reg.position);\n if(position) {\n style.backgroundPositionX = position[0];\n style.backgroundPositionY = position.length > 1 ? position[1] : position[0];\n }\n }\n delete style.background;\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n temp = temp.toString().split(/\\s+/);\n if(temp.length === 1) {\n temp[1] = '50%';\n }\n [style.backgroundPositionX, style.backgroundPositionY] = temp;\n delete style.backgroundPosition;\n }\n // flex\n temp = style.flex;\n if(temp) {\n if(temp === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(temp === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+$/.test(temp)) {\n parseFlex(style, Math.max(0, parseFloat(temp)), 1, 0);\n }\n else if(/^[\\d.]+px$/.test(temp)) {\n parseFlex(style, 1, 1, 0);\n }\n else if(/^[\\d.]+%$/.test(temp)) {\n parseFlex(style, 1, 1, temp);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(temp)) {\n let arr = temp.split(/\\s+/);\n parseFlex(style, arr[0], arr[1], 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+%$/.test(temp)) {\n let arr = temp.split(/\\s+/);\n parseFlex(style, arr[0], 1, arr[1]);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n delete style.flex;\n }\n // margin\n parseMarginPadding(style, 'margin');\n parseMarginPadding(style, 'padding');\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 // 默认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$/.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$/.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$/.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$/.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 // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n style[k + 'X'] = arr[0];\n style[k + 'Y'] = arr[1];\n delete style[k];\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$/.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*\\)/.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 return style;\n}\n\n// 影响文字测量的只有字体和大小,必须提前处理,另顺带处理掉布局相关的属性\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小,也需要提前处理\n * 继承相关的计算,包括布局的,以及渲染repaint的\n * @param node\n * @param isRoot\n */\nfunction compute(node, isRoot) {\n let { animateStyle } = node;\n let currentStyle = node.__currentStyle = animateStyle;\n let computedStyle = node.__computedStyle = {};\n let parentComputedStyle = isRoot ? null : node.parent.computedStyle;\n let { fontSize, fontFamily, textAlign, lineHeight } = currentStyle;\n if(fontSize.unit === INHERIT) {\n computedStyle.fontSize = isRoot ? DEFAULT_FONT_SIZE : parentComputedStyle.fontSize;\n }\n else if(fontSize.unit === PERCENT) {\n computedStyle.fontSize = isRoot ? DEFAULT_FONT_SIZE : parentComputedStyle.fontSize * fontSize.value * 0.01;\n }\n else {\n computedStyle.fontSize = fontSize.value;\n }\n if(fontFamily.unit === INHERIT) {\n computedStyle.fontFamily = isRoot ? 'arial' : parentComputedStyle.fontFamily;\n }\n else {\n computedStyle.fontFamily = fontFamily.value;\n }\n // 顺带将可提前计算且与布局相关的属性提前计算到computedStyle上,渲染相关的在各自render中做\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 repaint(node, isRoot, currentStyle);\n}\n\n// REPAINT等级下,刷新前首先执行,如继承等提前计算computedStyle\nfunction repaint(node, isRoot, currentStyle) {\n if(!currentStyle) {\n let { animateStyle } = node;\n currentStyle = node.__currentStyle = animateStyle;\n }\n let computedStyle = node.computedStyle;\n let parentComputedStyle = isRoot ? null : node.parent.computedStyle;\n let { fontStyle, fontWeight, color, visibility } = currentStyle;\n if(fontStyle.unit === INHERIT) {\n computedStyle.fontStyle = isRoot ? 'normal' : parentComputedStyle.fontStyle;\n }\n else {\n computedStyle.fontStyle = fontStyle.value;\n }\n if(fontWeight.unit === INHERIT) {\n computedStyle.fontWeight = isRoot ? 400 : parentComputedStyle.fontWeight;\n }\n else {\n computedStyle.fontWeight = fontWeight.value;\n }\n if(color.unit === INHERIT) {\n computedStyle.color = isRoot ? [0, 0, 0, 1] : parentComputedStyle.color;\n }\n else {\n computedStyle.color = color.value;\n }\n if(visibility === 'inherit') {\n computedStyle.visibility = isRoot ? 'visible' : parentComputedStyle.visibility;\n }\n else {\n computedStyle.visibility = visibility;\n }\n [\n 'opacity',\n 'zIndex',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundRepeat',\n 'backgroundImage',\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 computedStyle[k] = currentStyle[k].value;\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\nexport default {\n normalize,\n compute,\n repaint,\n setFontStyle,\n getBaseLine,\n calRelative,\n calAbsolute,\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","import css from '../style/css';\nimport util from '../util/util';\nimport mode from '../util/mode';\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) {\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', util.int2rgba(computedStyle.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 css from '../style/css';\nimport mode from '../util/mode';\nimport util from '../util/util';\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__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 __measure(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 __renderByMask(renderMode, ctx) {\n this.render(renderMode, ctx);\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 let vd = this.__virtualDom = {\n type: 'text',\n children: [],\n };\n const { isDestroyed, computedStyle, lineBoxes } = this;\n if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') {\n return;\n }\n if(renderMode === mode.CANVAS) {\n ctx.font = css.setFontStyle(computedStyle);\n ctx.fillStyle = util.int2rgba(computedStyle.color);\n }\n lineBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle);\n });\n if(renderMode === mode.SVG) {\n vd.children = lineBoxes.map(lineBox => lineBox.virtualDom);\n }\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\nexport default Text;\n","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","export default {\n REPAINT: 0,\n REFLOW: 1,\n};\n","export default {\n GEOM: {\n x1: true,\n y1: true,\n x2: true,\n y2: true,\n controlA: true,\n controlB: true,\n r: true,\n rx: true,\n ry: true,\n begin: true,\n end: true,\n points: true,\n controls: true,\n },\n STYLE: {\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 },\n};\n","import Node from './Node';\nimport Text from './Text';\nimport tool from './tool';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport css from '../style/css';\nimport level from '../animate/level';\nimport repaint from '../animate/repaint';\n\nconst { isNil, isString, isFunction, clone, extend } = util;\n\nclass Component extends Event {\n constructor(tagName, props, children) {\n super();\n if(!isString(tagName)) {\n children = props;\n props = tagName;\n tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n }\n this.__tagName = tagName;\n props = props || [];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n this.__props = props;\n }\n else {\n this.props = props;\n this.__props = util.hash2arr(props);\n }\n this.__children = children || [];\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.__state = {};\n this.__isMount = false;\n }\n\n setState(n, cb) {\n if(isNil(n)) {\n this.state = {};\n }\n else {\n extend(this.state, n);\n }\n let root = this.root;\n if(root) {\n root.delRefreshTask(this.__task);\n let ovd = this.shadowRoot;\n this.__task = {\n before: () => {\n this.__init(root, this);\n root.setRefreshLevel(level.REFLOW);\n },\n after: () => {\n if(ovd instanceof Node) {\n ovd.__destroy();\n }\n if(isFunction(cb)) {\n cb();\n }\n },\n };\n root.addRefreshTask(this.__task);\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n cb();\n }\n }\n\n __create() {\n let sr = this.render();\n // 可能返回的还是一个Component,递归处理\n while(sr instanceof Component) {\n sr = sr.render();\n }\n if(sr instanceof Node) {\n // 组件传入的样式需覆盖shadowRoot的\n let style = clone(this.props.style) || {};\n css.normalize(style);\n extend(sr.style, style);\n // 事件添加到sr,以及自定义事件\n this.__props.forEach(item => {\n let k = item[0];\n let v = item[1];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n let arr = sr.listener[k] = sr.listener[k] || [];\n if(arr.indexOf(v) === -1) {\n arr.push(v);\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, function(...args) {\n v(...args);\n });\n }\n });\n }\n else {\n let s = '';\n if(!isNil(sr)) {\n s = util.encodeHtml(sr.toString());\n }\n sr = new Text(s);\n }\n return this.__shadowRoot = sr;\n }\n\n __init(root, host) {\n tool.init(this, root, host);\n let sr = this.__create();\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点\n sr.__parent = this.parent;\n sr.__host = host;\n }\n else {\n sr.__init(root, this);\n }\n }\n\n render() {\n }\n\n __destroy() {\n let { componentWillUnmount } = this;\n if(isFunction(componentWillUnmount)) {\n componentWillUnmount.call(this);\n this.__isMount = false;\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.children.splice(0);\n this.__shadowRoot = null;\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n if(force) {\n return sr.__emitEvent(e, force);\n }\n let res = sr.__emitEvent(e);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n // Root布局前时measure调用,第一次渲染初始化生成shadowRoot\n __measure(renderMode, ctx) {\n let { root } = this;\n if(!this.__isMount) {\n this.__isMount = true;\n let { componentDidMount } = this;\n if(isFunction(componentDidMount)) {\n root.once(Event.REFRESH, () => {\n componentDidMount.call(this);\n });\n }\n }\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n sr.__measure(renderMode, ctx);\n }\n else {\n sr.__measure(renderMode, ctx, true);\n }\n }\n\n __repaint() {\n let sr = this.shadowRoot;\n if(!(sr instanceof Text)) {\n sr.__repaint(true);\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get children() {\n return this.__children;\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\nObject.keys(repaint.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]).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].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","import Text from '../node/Text';\rimport util from './util';\r\rconst SPF = 1000 / 60;\r\rconst CANVAS = {\r cache: null,\r mask: null,\r};\r\rfunction cacheCanvas(key, width, height) {\r let o;\r if(!CANVAS[key]) {\r o = CANVAS[key] = document.createElement('canvas');\r o.style.position = 'absolute';\r o.style.left = '9999px';\r o.style.top = '-9999px';\r document.body.append(o);\r }\r o = CANVAS[key];\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\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`;\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 performance.now();\r }\r inject.now = Date.now.bind(Date);\r return Date.now();\r },\r getCacheCanvas(width, height) {\r return cacheCanvas('cache', width, height);\r },\r getMaskCanvas(width, height) {\r return cacheCanvas('mask', 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 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\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(!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(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n get task() {\n return this.__task;\n }\n\n get aTask() {\n return this.__aTask;\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 util from '../util/util';\nimport Event from '../util/Event';\nimport frame from './frame';\nimport easing from './easing';\nimport level from './level';\nimport repaint from './repaint';\n\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER } = unit;\nconst { isNil, isFunction, isNumber, isObject, clone, equalArr } = util;\nconst { linear } = easing;\n\nconst 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\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)) {\n if(repaint.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// 对比两个样式的某个值是否相等\nfunction equalStyle(k, a, b) {\n if(k === 'transform') {\n return equalArr(a[0][1], b[0][1]);\n }\n else 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(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n else 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 else 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 else 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 else if(COLOR_HASH.hasOwnProperty(k)) {\n return a.unit === b.unit && equalArr(a.value, b.value);\n }\n else 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 else if(repaint.GEOM.hasOwnProperty(k)) {\n if(k === 'points' || k === 'controls') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(a[i] === b[i]) {\n continue;\n }\n if(a[i][0] !== b[i][0] || a[i][1] !== b[i][1]) {\n return false;\n }\n }\n return true;\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(a.length !== b.length) {\n return false;\n }\n return a[0] === b[0] && a[1] === b[1];\n }\n }\n return a === b;\n}\n\nfunction isStyleReflow(k) {\n return !repaint.STYLE.hasOwnProperty(k) && !repaint.GEOM.hasOwnProperty(k);\n}\n\n// 计算是否需要刷新和刷新等级,新样式和之前样式对比\nfunction calRefresh(frameStyle, lastStyle, keys) {\n let res = false;\n let lv = level.REPAINT;\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let n = frameStyle[k];\n let p = lastStyle[k];\n // 前后均非空对比\n if(!isNil(n) && !isNil(p)) {\n if(!equalStyle(k, n, p)) {\n res = true;\n // 不相等且刷新等级是重新布局时可以提前跳出\n if(lv === level.REPAINT) {\n if(isStyleReflow(k)) {\n lv = level.REFLOW;\n break;\n }\n }\n else {\n break;\n }\n }\n }\n // 有一个为空时即不等\n else if(!isNil(n) || !isNil(p)) {\n res = true;\n if(isStyleReflow(k)) {\n lv = level.REFLOW;\n break;\n }\n }\n }\n return [res, lv];\n}\n\n// 将当前frame的style赋值给动画style,xom绘制时获取\nfunction genBeforeRefresh(frameStyle, animation, root, lv) {\n root.setRefreshLevel(lv);\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n root.__frameHook();\n let style = {};\n let props = {};\n Object.keys(frameStyle).forEach(i => {\n let v = frameStyle[i];\n if(isNil(v)) {\n return;\n }\n // geom的属性变化\n if(repaint.GEOM.hasOwnProperty(i)) {\n props[i] = v;\n style[i] = v;\n }\n // 样式\n else {\n style[i] = v;\n }\n });\n animation.__style = style;\n animation.__props = props;\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 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(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 res.n = p;\n return res;\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 res.n = p;\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 let computedStyle = target.computedStyle;\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 if(p.unit === AUTO || n.unit === AUTO) {\n res.n = p;\n return res;\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(repaint.GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n res.n = null;\n }\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p)) {\n return p;\n }\n if(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(nv);\n }\n else {\n let v = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n if(isNil(pv[j]) || isNil(nv[j])) {\n v.push(nv[j]);\n }\n else {\n v.push(nv[j] - pv[j]);\n }\n }\n res.v.push(v);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p)) {\n return p;\n }\n if(equalArr(p, n)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1]\n ];\n }\n else {\n if(n === p) {\n return;\n }\n res.v = n - p;\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 if(n === p) {\n return;\n }\n res.n = p;\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 * @returns {*}\n */\nfunction calIntermediateStyle(frame, percent) {\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, n, d, p } = item;\n let st = style[k];\n // 没有中间态的如display\n if(item.hasOwnProperty('n')) {\n style[k] = n;\n }\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n else 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(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(repaint.GEOM.hasOwnProperty(k)) {\n let st = style[k];\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n if(isNil(st[i]) || !st[i].length) {\n continue;\n }\n for(let j = 0, len2 = Math.min(st[i].length, v[i].length); j < len2; j++) {\n if(!isNil(st[i][j]) && !isNil(v[i][j])) {\n st[i][j] += v[i][j] * percent;\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n }\n else {\n style[k] += v * percent;\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.__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 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 }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\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 // 再计算两帧之间的变化,存入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 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 }\n }\n else {\n this.__playCount = this.__currentTime = 0;\n this.__playState = 'idle';\n this.__style = {};\n }\n };\n // 生成finish的任务事件\n this.__fin = (cb) => {\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();\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 keys,\n __clean,\n __fin,\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, style, 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 let needRefresh, lv;\n // 还没过前置delay\n if(currentTime < delay) {\n if(stayBegin) {\n let current = frames[0].style;\n // 对比第一帧,以及和第一帧同key的当前样式\n [needRefresh, lv] = calRefresh(current, style, keys);\n if(needRefresh) {\n genBeforeRefresh(current, this, root, lv);\n }\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 [needRefresh, lv] = calRefresh(current, style, keys);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = {};\n [needRefresh, lv] = calRefresh(current, style, keys);\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);\n [needRefresh, lv] = calRefresh(current, style, keys);\n }\n // 两帧之间没有变化,不触发刷新仅触发frame事件,有变化生成计算结果赋给style\n if(needRefresh) {\n genBeforeRefresh(current, this, root, lv);\n }\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 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.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, style, keys, frames, __frameCb, __clean, __fin } = self;\n if(root) {\n let needRefresh, lv, current;\n // 停留在最后一帧\n if(self.__stayEnd()) {\n current = frames[frames.length - 1].style;\n [needRefresh, lv] = calRefresh(current, style, keys);\n }\n else {\n current = {};\n [needRefresh, lv] = calRefresh(current, style, keys);\n }\n if(needRefresh) {\n frame.nextFrame(this.__enterFrame = {\n before: () => {\n genBeforeRefresh(current, this, root, lv);\n __clean(true);\n },\n after: diff => {\n __frameCb(diff);\n __fin(cb);\n },\n });\n }\n // 无刷新同步进行\n else {\n __clean(true);\n __fin(cb);\n }\n }\n return self;\n }\n\n cancel(cb) {\n let { isDestroyed, duration, playState, list } = this;\n if(isDestroyed || duration <= 0 || playState === 'idle' || list.length < 1) {\n return this;\n }\n this.__cancelTask();\n let { root, style, keys, __frameCb, __clean } = this;\n if(root) {\n let [needRefresh, lv] = calRefresh({}, style, keys);\n let task = () => {\n this.__cancelTask();\n this.__begin = this.__end = this.__isDelay = this.__finish = this.__inFps = this.__enterFrame = null;\n this.emit(Event.CANCEL);\n if(isFunction(cb)) {\n cb();\n }\n };\n if(needRefresh) {\n frame.nextFrame(this.__enterFrame = {\n before: () => {\n genBeforeRefresh({}, this, root, lv);\n __clean();\n },\n after: diff => {\n __frameCb(diff);\n task();\n },\n });\n }\n // 无刷新同步进行\n else {\n __clean();\n task();\n }\n }\n return this;\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 __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() {\n this.__clean && this.__clean();\n this.__startTime = null;\n this.__isDestroyed = true;\n this.removeControl();\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 props() {\n return this.__props;\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\nexport default Animation;\n","function genCanvasPolygon(ctx, list) {\n ctx.beginPath();\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(item.length === 2) {\n ctx.lineTo(item[0], item[1]);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0], item[1], item[2], item[3]);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0], item[1], item[2], item[3], item[4], item[5]);\n }\n }\n ctx.fill();\n ctx.closePath();\n}\n\nfunction genSvgPolygon(list) {\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(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 // s += `L${list[0][0]},${list[0][1]}`;\n return s;\n}\n\nexport default {\n genCanvasPolygon,\n genSvgPolygon,\n};\n","import Node from './Node';\nimport tool from './tool';\nimport mode from '../util/mode';\nimport reset from '../style/reset';\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 util from '../util/util';\nimport Component from './Component';\nimport Animation from '../animate/Animation';\nimport inject from '../util/inject';\nimport draw from '../util/draw';\nimport mx from '../math/matrix';\n\nconst { AUTO, PX, PERCENT, STRING } = unit;\nconst { clone, int2rgba, equalArr, extend, joinArr } = util;\nconst { calRelative, compute, repaint } = css;\nconst { genCanvasPolygon, genSvgPolygon } = draw;\n\nfunction renderBorder(renderMode, points, color, ctx, xom) {\n color = int2rgba(color);\n if(renderMode === mode.CANVAS) {\n ctx.fillStyle = color;\n points.forEach(point => {\n genCanvasPolygon(ctx, point);\n });\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += genSvgPolygon(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) {\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.fillStyle = color;\n if(list) {\n genCanvasPolygon(ctx, list);\n }\n else {\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.fill();\n ctx.closePath();\n }\n }\n else if(renderMode === mode.SVG) {\n if(list) {\n let d = genSvgPolygon(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 item.value;\n }\n else {\n return 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\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 this.__props = props;\n }\n else {\n this.props = props;\n this.__props = util.hash2arr(props);\n }\n this.__tagName = tagName;\n // 引用如json时由于直接normalize处理style对象,需clone防止影响,比如再次渲染时style格式错误\n this.__style = clone(this.props.style) || {}; // style被解析后的k-v形式\n this.__currentStyle = this.__style; // 动画过程中绘制一开始会merge动画样式\n this.__listener = {};\n this.__props.forEach(item => {\n let k = item[0];\n let v = item[1];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n let arr = this.__listener[k] = this.__listener[k] || [];\n if(arr.indexOf(v) === -1) {\n arr.push(v);\n }\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\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标明先假布局一次计算尺寸\n __layout(data, isVirtual, fromAbs) {\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 computedStyle.width = computedStyle.height = 0;\n return;\n }\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种布局\n if(display === 'block') {\n this.__layoutBlock(data, isVirtual);\n }\n else if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inline') {\n this.__layoutInline(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 // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n let ac = this.root.animateController;\n ac.__records = ac.records.concat(ar);\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 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 } = this;\n // 圆角边计算\n calBorderRadius(outerWidth, outerHeight, currentStyle, computedStyle);\n let {\n display,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n backgroundColor,\n borderTopWidth,\n borderTopColor,\n borderTopStyle,\n borderRightWidth,\n borderRightColor,\n borderRightStyle,\n borderBottomWidth,\n borderBottomColor,\n borderBottomStyle,\n borderLeftWidth,\n borderLeftColor,\n borderLeftStyle,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n backgroundRepeat,\n backgroundImage,\n opacity,\n filter,\n } = computedStyle;\n let {\n backgroundSize,\n backgroundPositionX,\n backgroundPositionY,\n transform,\n transformOrigin,\n } = currentStyle;\n // 使用sx和sy渲染位置,考虑了relative和translate影响\n let { sx: x, sy: y } = this;\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 // 先设置透明度,canvas可以向上累积\n if(renderMode === mode.CANVAS) {\n let parent = this.parent;\n while(parent) {\n opacity *= parent.computedStyle.opacity;\n parent = parent.parent;\n }\n ctx.globalAlpha = opacity;\n }\n else {\n this.__virtualDom.opacity = opacity;\n }\n // transform和transformOrigin相关\n let tfo = tf.calOrigin(transformOrigin, outerWidth, outerHeight);\n computedStyle.transformOrigin = tfo.slice(0);\n tfo[0] += x;\n tfo[1] += y;\n // canvas继承祖先matrix,没有则恢复默认,防止其它matrix影响;svg则要考虑事件\n let matrix = [1, 0, 0, 1, 0, 0];\n this.__matrix = computedStyle.matrix = matrix;\n if(isDestroyed || display === 'none') {\n return;\n }\n let parent = this.parent;\n // transform相对于自身\n if(transform) {\n matrix = tf.calMatrix(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;\n matrix = tf.calMatrixByOrigin(matrix, tfo);\n let renderMatrix = matrix;\n // 变换对事件影响,canvas要设置渲染\n if(parent) {\n if(parent.matrixEvent) {\n matrix = mx.multiply(parent.matrixEvent, matrix);\n // break;\n }\n // parent = parent.parent;\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 computedStyle.backgroundPositionX = backgroundPositionX.unit === PX\n ? backgroundPositionX.value : backgroundPositionX.value * innerWidth;\n computedStyle.backgroundPositionY = backgroundPositionY.unit === PX\n ? backgroundPositionY.value : backgroundPositionY.value * innerWidth;\n backgroundSize = calBackgroundSize(backgroundSize, innerWidth, innerHeight);\n computedStyle.backgroundSize = backgroundSize;\n // 隐藏不渲染\n if(visibility === 'hidden') {\n computedStyle.visibility = 'hidden';\n return;\n }\n // 背景色垫底\n if(backgroundColor[3] > 0) {\n renderBgc(renderMode, int2rgba(backgroundColor), x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n let loadBgi = this.__loadBgi;\n if(util.isString(backgroundImage)) {\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\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 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 let c;\n let currentCtx;\n // 在离屏canvas上绘制\n if(needMask) {\n let { width, height } = this.root;\n c = inject.getCacheCanvas(width, height);\n currentCtx = c.ctx;\n // 和当前画布matrix一致,防止当前设置值导致离屏绘制超出边界\n currentCtx.setTransform(...matrix);\n }\n else {\n currentCtx = ctx;\n }\n // 先画不考虑repeat的中心声明的\n currentCtx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n currentCtx.drawImage(source, item[0], item[1], w, h);\n });\n // mask特殊处理画回来\n if(needMask) {\n currentCtx.globalCompositeOperation = 'destination-in';\n renderBgc(renderMode, '#FFF', x2, y2, innerWidth, innerHeight, currentCtx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n // 将离屏内容绘制回来时先重置默认matrix,因为离屏已经保持一致\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(c.canvas, 0, 0);\n // 绘完后变正常即可\n ctx.setTransform(...matrix);\n currentCtx.globalCompositeOperation = 'source-over';\n let { width, height } = this.root;\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.clearRect(0, 0, width, height);\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 maskId = defs.add({\n tagName: 'mask',\n props: [],\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.bbMask = 'url(#' + maskId + ')';\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 else {\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 this.root.delRefreshTask(loadBgi.cb);\n this.root.addRefreshTask(loadBgi.cb);\n }\n }, {\n width: innerWidth,\n height: innerHeight,\n });\n }\n }\n else if(backgroundImage.k) {\n let bgi = this.__gradient(renderMode, ctx, defs, x2, y2, x3, y3, innerWidth, innerHeight, backgroundImage);\n renderBgc(renderMode, bgi, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\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, 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, 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, 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, borderLeftColor, ctx, this);\n }\n if(filter) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0 && renderMode === mode.SVG) {\n // 模糊框卷积尺寸 #66\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 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\n __renderByMask(renderMode, ctx, defs) {\n let { prev, root } = this;\n let hasMask = prev && prev.isMask;\n if(!hasMask) {\n this.render(renderMode, ctx, defs);\n return;\n }\n if(renderMode === mode.CANVAS) {\n // canvas借用2个离屏canvas来处理,c绘制本xom,m绘制多个mask\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height);\n this.render(renderMode, c.ctx);\n // 收集之前的mask列表\n let list = [];\n while(prev && prev.isMask) {\n list.unshift(prev);\n prev = prev.prev;\n }\n // 当mask只有1个时,无需生成m,直接在c上即可\n if(list.length === 1) {\n prev = list[0];\n c.ctx.globalCompositeOperation = 'destination-in';\n prev.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.getMaskCanvas(width, height);\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 // 清除\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, width, height);\n c.draw(c.ctx);\n }\n else if(renderMode === mode.SVG) {\n this.render(renderMode, ctx, defs);\n // 作为mask会在defs生成maskId供使用,多个连续mask共用一个id\n this.virtualDom.mask = prev.maskId;\n }\n }\n\n __destroy() {\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 super.__destroy();\n this.__matrix = this.__matrixEvent = this.__root = null;\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { event: { type } } = e;\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { isGeom, listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n let childWillResponse;\n // touchmove之类强制的直接通知即可\n if(force) {\n if(!isGeom) {\n // 先响应absolute/relative高优先级,再看普通流,综合zIndex和从后往前遮挡顺序\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, force)) {\n childWillResponse = true;\n }\n }\n }\n }\n // touchmove之类也需要考虑target是否是自己以及孩子\n if(!childWillResponse && this.root.__touchstartTarget !== this) {\n return;\n }\n if(e.__stopPropagation) {\n return;\n }\n if(['touchmove', 'touchend', 'touchcancel'].indexOf(type) > -1) {\n e.target = this.root.__touchstartTarget;\n }\n if(cb) {\n cb.forEach(item => {\n if(e.__stopImmediatePropagation) {\n return;\n }\n item(e);\n });\n }\n return true;\n }\n if(!isGeom) {\n // 先响应absolute/relative高优先级,再看普通流,综合zIndex和从后往前遮挡顺序\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 childWillResponse = true;\n }\n }\n }\n }\n if(e.__stopPropagation) {\n return;\n }\n // child触发则parent一定触发,否则判断事件坐标是否在节点内且未被遮挡\n if(childWillResponse || this.willResponseEvent(e)) {\n e.__hasEmitted = true;\n if(cb) {\n cb.forEach(item => {\n if(e.__stopImmediatePropagation) {\n return;\n }\n if(util.isFunction(item)) {\n item(e);\n }\n });\n }\n return true;\n }\n }\n\n willResponseEvent(e) {\n let { x, y, __hasEmitted } = e;\n if(__hasEmitted) {\n return;\n }\n let { sx, sy, outerWidth, outerHeight, matrixEvent } = this;\n let inThis = tf.pointInQuadrilateral(x, y,\n sx, sy,\n sx + outerWidth, sy,\n sx + outerWidth, sy + outerHeight,\n sx, sy + outerHeight,\n matrixEvent);\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 __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 animate(list, options, underControl) {\n if(this.isDestroyed) {\n return;\n }\n let animation = new Animation(this, list, options);\n this.animationList.push(animation);\n if(underControl) {\n this.root.animateController.add(animation);\n }\n if(options.hasOwnProperty('autoPlay') && !options.autoPlay) {\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 __init(root, host) {\n tool.init(this, root, host);\n }\n\n __measure(renderMode, ctx, isRoot) {\n compute(this, isRoot);\n }\n\n __repaint(isRoot) {\n repaint(this, isRoot);\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get isGeom() {\n return this.tagName.charAt(0) === '$';\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 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 animateStyle() {\n let { style, animationList } = this;\n let copy;\n animationList.forEach(item => {\n if(item.animating) {\n if(!copy) {\n copy = extend({}, style, this.isGeom ? reset.domKey.concat(reset.geomKey) : reset.domKey);\n }\n extend(copy, item.style);\n }\n });\n return copy || style;\n }\n\n get currentStyle() {\n return this.__currentStyle;\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);\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.width;\n });\n return width;\n }\n\n get height() {\n let height = 0;\n this.list.forEach(item => {\n height = Math.max(height, item.height);\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\nexport default LineGroup;\n","import Xom from './Xom';\nimport Text from './Text';\nimport LineGroup from './LineGroup';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport mode from '../util/mode';\nimport Component from './Component';\nimport util from '../util/util';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { calAbsolute } = css;\n\nconst TAG_NAME = {\n 'div': true,\n 'span': true,\n 'img': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n};\n\nfunction isRelativeOrAbsolute(node) {\n return ['relative', 'absolute'].indexOf(node.computedStyle.position) > -1;\n}\n\n/**\n * 1. 封装string为Text节点\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点\n */\nfunction flatten(parent, children) {\n let list = [];\n traverse(parent, list, children, {\n lastText: null,\n prev: null,\n });\n return list;\n}\n\nfunction traverse(parent, list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverse(parent, list, item, options);\n });\n }\n else if(children instanceof Xom) {\n if(['canvas', 'svg'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg');\n }\n list.push(children);\n children.__parent = parent;\n options.lastText = null;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n }\n else if(children instanceof Component) {\n list.push(children);\n children.__parent = parent;\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText) {\n options.lastText.content += children;\n }\n else {\n let text = options.lastText = new Text(children);\n list.push(text);\n text.__parent = parent;\n if(options.prev) {\n options.prev.__next = text;\n text.__prev = options.prev;\n }\n options.prev = text;\n }\n }\n}\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(INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n css.normalize(style, reset.dom);\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 } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = computedStyle;\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 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 = borderRightWidth + borderLeftWidth + 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 + borderBottomWidth + 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;\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;\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;\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 // 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);\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 // 只针对绝对定位children布局\n __layoutAbs(container, data) {\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 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 -= computedStyle.borderLeftWidth;\n x2 -= computedStyle.borderRightWidth;\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 -= computedStyle.borderTopWidth;\n y2 -= computedStyle.borderBottomWidth;\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 // 递归进行,遇到absolute/relative的设置新容器\n children.forEach(item => {\n if(item instanceof Dom) {\n item.__layoutAbs(['absolute', 'relative'].indexOf(item.computedStyle.position) > -1 ? 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 super.render(renderMode, ctx, defs);\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) {\n item.__renderAsMask(renderMode, ctx, defs);\n }\n });\n // 按照zIndex排序绘制过滤mask,同时由于svg严格按照先后顺序渲染,没有z-index概念,需要排序将relative/absolute放后面\n let zIndex = this.zIndexChildren;\n // 再绘制relative和absolute\n zIndex.forEach(item => {\n item.__renderByMask(renderMode, ctx, defs);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = zIndex.map(item => item.virtualDom);\n }\n }\n\n __init(root, host) {\n super.__init(root, host);\n (this.__children = flatten(this, this.children))\n .forEach(item => {\n if(item instanceof Xom || item instanceof Component) {\n item.__init(root, host);\n }\n });\n }\n\n __measure(renderMode, ctx, isRoot) {\n super.__measure(renderMode, ctx, isRoot);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__measure(renderMode, ctx);\n });\n }\n\n __repaint(isRoot) {\n super.__repaint(isRoot);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n if(item instanceof Xom || item instanceof Component) {\n item.__repaint();\n }\n });\n }\n\n __destroy() {\n this.children.forEach(child => {\n child.__destroy();\n });\n super.__destroy();\n this.children.splice(0);\n this.lineGroups.splice(0);\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.computedStyle && item.computedStyle.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.computedStyle && item.computedStyle.position === 'absolute';\n });\n }\n\n get zIndexChildren() {\n let noAbs = true;\n let zIndex = this.children.filter((item, i) => {\n // 临时变量为排序使用\n item.__iIndex = i;\n let isXom = item instanceof Xom;\n item.__iXom = isXom;\n if(isXom) {\n let isAbs = isRelativeOrAbsolute(item);\n if(isAbs) {\n item.__iAbs = isAbs;\n noAbs = false;\n }\n }\n // 不是遮罩,并且已有computedStyle,特殊情况下中途插入的节点还未渲染\n return !item.isMask && item.computedStyle;\n });\n // 提前跳出\n if(noAbs) {\n return zIndex;\n }\n zIndex.sort(function(a, b) {\n if(a.__iXom && b.__iXom) {\n if(a.__iAbs && b.__iAbs) {\n if(a.computedStyle.zIndex !== b.computedStyle.zIndex) {\n return a.computedStyle.zIndex - b.computedStyle.zIndex;\n }\n }\n else if(a.__iAbs) {\n return 1;\n }\n else if(b.__iAbs) {\n return -1;\n }\n }\n else if(a.__iXom) {\n if(a.__iAbs) {\n return 1;\n }\n }\n else if(b.__iXom) {\n if(b.__iAbs) {\n return -1;\n }\n }\n return a.__iIndex - b.__iIndex;\n });\n return zIndex;\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 static isValid(s) {\n return TAG_NAME.hasOwnProperty(s);\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from '../util/mode';\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 draw from '../util/draw';\nimport level from '../animate/level';\n\nconst { AUTO } = unit;\nconst { genCanvasPolygon, genSvgPolygon } = draw;\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 // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\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 }\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.__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 let { width: w, height: h } = this.root;\n let c = inject.getCacheCanvas(w, h);\n c.ctx.drawImage(source, originX, originY, width, height);\n c.ctx.globalCompositeOperation = 'destination-in';\n c.ctx.fillStyle = '#FFF';\n genCanvasPolygon(ctx, list);\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, w, h);\n c.draw(c.ctx);\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\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 = genSvgPolygon(list);\n let maskId = defs.add({\n tagName: 'mask',\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.conMask = 'url(#' + maskId + ')';\n }\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n props.push(['transform', 'matrix(' + util.joinArr(matrix, ',') + ')']);\n }\n this.virtualDom.children.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n }\n }\n }\n else {\n let loadImg = this.__loadImg;\n loadImg.url = src;\n loadImg.source = null;\n loadImg.error = null;\n inject.measureImg(src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.url && !this.__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 } } = this;\n root.delRefreshTask(loadImg.cb);\n root.delRefreshTask(this.__task);\n if(width.unit !== AUTO && height.unit !== AUTO) {\n root.addRefreshTask(loadImg.cb);\n }\n else {\n root.addRefreshTask(this.__task = {\n before() {\n root.setRefreshLevel(level.REFLOW);\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","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.bbMask, nvd.bbMask);\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, filter, conMask } = 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 // geom不会有mask,对比一直相等\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\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.conMask !== conMask) {\n if(conMask) {\n elem.childNodes[1].setAttribute('mask', conMask);\n }\n else {\n elem.childNodes[1].removeAttribute('mask');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n diffX2X(elem, ovd, nvd);\n if(!root) {\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbMask, nvd.bbMask);\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.bbMask, nvd.bbMask);\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 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 diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbMask, nvd.bbMask);\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, oMask, nMask) {\n let ol = obb.length;\n let nl = nbb.length;\n if(oMask !== nMask) {\n if(!nMask) {\n elem.removeAttribute('mask');\n }\n else {\n elem.setAttribute('mask', nMask);\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 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","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/util';\n\nconst { isNil, isFunction } = util;\n\nconst LIST = [\n 'playbackRate',\n 'iterations',\n 'fps',\n 'spfLimit',\n 'delay',\n 'endDelay',\n 'duration',\n 'direction',\n 'fill',\n 'playCount',\n 'currentTime',\n 'easing',\n];\n\nfunction replaceOption(target, globalValue, key, vars) {\n // 优先vars,其次总控,都没有忽略即自己原本声明\n if(!isNil(globalValue)) {\n let decl = target['var-' + key];\n if(!decl) {\n target[key] = globalValue;\n }\n else {\n let id = decl.id;\n if(!id || !vars[id]) {\n target[key] = globalValue;\n }\n }\n }\n}\n\nfunction replaceGlobal(global, options) {\n LIST.forEach(k => {\n if(global.hasOwnProperty(k)) {\n replaceOption(options, global[k], k, global.vars);\n }\n });\n}\n\nclass Controller {\n constructor() {\n this.__records = [];\n this.__list = [];\n }\n\n __op(options) {\n this.records.forEach(record => {\n let { animate } = record;\n if(Array.isArray(animate)) {\n animate.forEach(item => {\n // 用总控替换动画属性中的值,注意vars优先级\n replaceGlobal(options, item.options);\n });\n }\n else {\n replaceGlobal(options, animate.options);\n }\n });\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.__list = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init() {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n let records = this.records;\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.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 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 records() {\n return this.__records;\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 '../node/Dom';\nimport util from '../util/util';\nimport mode from '../util/mode';\nimport diff from '../util/diff';\nimport Defs from './Defs';\nimport unit from '../style/unit';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport level from '../animate/level';\nimport Controller from '../animate/Controller';\n\nconst { isNil, isObject, isFunction } = util;\n\nconst { PX } = unit;\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(node) {\n ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(type => {\n node.addEventListener(type, e => {\n node.__root.__cb(e, ['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1);\n });\n });\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props, children);\n this.__node = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n this.__task = [];\n this.__ref = {};\n this.__animateController = new Controller();\n this.__init(this, this);\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 }\n\n __genHtml() {\n let res = `<${this.tagName}`;\n // 拼接处理属性\n for(let i = 0, len = this.__props.length; i < len; i++) {\n let item = this.__props[i];\n let [k, v] = item;\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n }\n res += `>`;\n return res;\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接强制响应\n __cb(e, force) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { node } = this;\n let { x: x2, y: y2, left, top, width, height } = node.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 let sx = width / this.width;\n let sy = height / this.height;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标\n if(sx !== 1) {\n x /= sx;\n }\n if(sy !== 1) {\n y /= sy;\n }\n }\n let data = {\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 this.__emitEvent(data, force);\n return data;\n }\n\n appendTo(dom) {\n dom = getDom(dom);\n this.__initProps();\n this.__refreshLevel = level.REFLOW;\n // 已有root节点\n if(dom.nodeName.toUpperCase() === this.tagName.toUpperCase()) {\n this.__node = 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.__node = dom.querySelector(this.tagName);\n if(!this.__node) {\n dom.innerHTML = this.__genHtml();\n this.__node = dom.querySelector(this.tagName);\n }\n }\n this.__uuid = isNil(this.__node.__uuid) ? uuid++ : this.__node.__uuid;\n this.__defs = this.node.__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.__node.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n this.refresh();\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.node.__root) {\n this.node.__root.__destroy();\n }\n else {\n initEvent(this.node);\n this.node.__uuid = this.__uuid;\n }\n this.node.__root = this;\n }\n\n refresh(cb) {\n let { isDestroyed, renderMode, ctx, defs, style } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(style.display) === -1) {\n style.display = 'block';\n }\n // 同理position不能为absolute\n if(style.position === 'absolute') {\n style.position = 'static';\n }\n // 根节点满宽高\n style.width = {\n value: this.width,\n unit: PX,\n };\n style.height = {\n value: this.height,\n unit: PX,\n };\n // 计算css继承,获取所有字体和大小并准备测量文字\n let lv = this.__refreshLevel;\n this.__refreshLevel = level.REPAINT;\n if(lv === level.REFLOW) {\n this.__measure(renderMode, ctx, true);\n }\n inject.measureText(() => {\n // 第一次默认REFLOW以及动画设计变更等需要布局\n if(lv === level.REFLOW) {\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: this.width,\n h: this.height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: this.width,\n h: this.height,\n });\n }\n // 没发生REFLOW只需要计算继承\n else {\n this.__repaint(true);\n }\n if(renderMode === mode.CANVAS) {\n this.__clear();\n }\n this.render(renderMode, ctx, defs);\n if(renderMode === mode.SVG) {\n let nvd = this.virtualDom;\n let nd = defs;\n nvd.defs = nd.value;\n if(this.node.__root) {\n diff(this.node, this.node.__vd, nvd);\n }\n else {\n this.node.innerHTML = util.joinVirtualDom(nvd);\n }\n this.node.__vd = nvd;\n this.node.__defs = nd;\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH, lv);\n });\n }\n\n addRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task } = 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 clone.forEach(item => {\n if(isObject(item) && isFunction(item.before)) {\n item.before(diff);\n }\n });\n this.refresh();\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 }\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 setRefreshLevel(lv) {\n if(lv > this.__refreshLevel) {\n this.__refreshLevel = lv;\n }\n }\n\n __frameHook() {\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\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() {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n this.__ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.__ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n\n get node() {\n return this.__node;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\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 '../util/mode';\nimport util from '../util/util';\nimport matrix from '../math/matrix';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { clone, int2rgba, isNil, extend, joinArr } = util;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMask = !!this.props.mask;\n this.__currentProps = this.props;\n let { style, isMask } = this;\n if(isMask) {\n style.visibility = 'visible';\n style.background = null;\n style.border = null;\n style.strokeWidth = 0;\n style.stroke = null;\n }\n css.normalize(this.style, reset.dom.concat(reset.geom));\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 }\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 }\n\n __preRender(renderMode, ctx, defs) {\n let { sx: x, sy: y, width, height, currentStyle, computedStyle } = this;\n let {\n strokeWidth,\n fill,\n stroke,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = currentStyle;\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 if(strokeWidth.unit === PX) {\n strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n strokeWidth = 0;\n }\n computedStyle.strokeWidth = strokeWidth;\n computedStyle.stroke = stroke;\n if(stroke && (stroke.k === 'linear' || stroke.k === 'radial')) {\n stroke = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, stroke);\n }\n else {\n stroke = int2rgba(stroke);\n }\n computedStyle.fill = fill;\n if(fill && (fill.k === 'linear' || fill.k === 'radial')) {\n fill = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, fill);\n }\n else {\n fill = int2rgba(fill);\n }\n computedStyle.strokeWidth = strokeWidth;\n computedStyle.strokeDasharray = strokeDasharray;\n computedStyle.strokeLinecap = strokeLinecap;\n return {\n x,\n y,\n originX,\n originY,\n cx,\n cy,\n display,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr: util.joinArr(strokeDasharray, ','),\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 this.virtualDom.type = 'geom';\n }\n let { isDestroyed, animateProps, computedStyle: { display } } = this;\n this.__currentProps = animateProps;\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) {\n // mask渲染在canvas等被遮罩层调用,svg生成maskId\n if(renderMode === mode.SVG) {\n this.render(renderMode, ctx, defs);\n let vd = this.virtualDom;\n vd.isMask = true;\n // svg的mask没有transform,需手动计算变换后的坐标应用\n let children = clone(vd.children);\n let m = this.matrixEvent;\n children.forEach(child => {\n let xi = 0;\n let yi = 1;\n let x, y;\n let props = child.props;\n if(child.tagName === 'rect') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'x') {\n xi = i;\n x = v;\n }\n else if(k === 'y') {\n yi = i;\n y = v;\n }\n }\n let point = matrix.calPoint([x, y], m);\n props[xi][1] = point[0];\n props[yi][1] = point[1];\n }\n else if(child.tagName === 'circle' || child.tagName === 'ellipse') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'cx') {\n xi = i;\n x = v;\n }\n else if(k === 'cy') {\n yi = i;\n y = v;\n }\n }\n let point = matrix.calPoint([x, y], m);\n props[xi][1] = point[0];\n props[yi][1] = point[1];\n }\n else if(child.tagName === 'polyline') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'points') {\n props[i][1] = v.replace(/([\\d.]+),([\\d.]+)/g, ($0, $1, $2) => {\n return joinArr(matrix.calPoint([$1, $2], m), ',');\n });\n break;\n }\n }\n }\n else if(child.tagName === 'path') {\n for(let i = 0, len = props.length; i < len; i++) {\n let [k, v] = props[i];\n if(k === 'd') {\n props[i][1] = v.replace(/([\\d.]+),([\\d.]+)/g, ($0, $1, $2) => {\n return joinArr(matrix.calPoint([$1, $2], m), ',');\n });\n break;\n }\n }\n }\n });\n // 连续多个mask需要合并\n let { prev } = this;\n if(prev && prev.isMask) {\n let last = defs.value;\n last = last[last.length - 1];\n last.children = last.children.concat(children);\n this.__maskId = prev.maskId;\n return;\n }\n let maskId = defs.add({\n tagName: 'mask',\n props: [],\n children,\n });\n this.__maskId = 'url(#' + maskId + ')';\n }\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 isMask() {\n return this.__isMask;\n }\n\n get maskId() {\n return this.__maskId;\n }\n\n get animateProps() {\n let { props, animationList } = this;\n let copy;\n animationList.forEach(item => {\n if(item.animating) {\n if(!copy) {\n copy = extend({}, props);\n }\n extend(copy, item.props, item.keys);\n }\n });\n return copy || props;\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 '../util/mode';\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n this.__x1 = this.__y1 = 0;\n this.__x2 = this.__y2 = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(this.props.x1 !== undefined) {\n this.__x1 = parseFloat(this.props.x1) || 0;\n }\n if(this.props.y1 !== undefined) {\n this.__y1 = parseFloat(this.props.y1) || 0;\n }\n if(this.props.x2 !== undefined) {\n this.__x2 = parseFloat(this.props.x2) || 0;\n }\n if(this.props.y2 !== undefined) {\n this.__y2 = parseFloat(this.props.y2) || 0;\n }\n if(Array.isArray(this.props.controlA)) {\n this.__controlA = this.props.controlA;\n }\n if(Array.isArray(this.props.controlB)) {\n this.__controlB = this.props.controlB;\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n display,\n visibility,\n originX,\n originY,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, x1, y1, x2, y2, controlA, controlB } = this;\n x1 = originX + x1 * width;\n y1 = originY + y1 * height;\n x2 = originX + x2 * width;\n y2 = originY + y2 * height;\n let curve = 0;\n // 控制点,曲线\n let cx1, cy1, cx2, cy2;\n if(controlA.length === 2) {\n curve++;\n cx1 = originX + controlA[0] * width;\n cy1 = originY + controlA[1] * height;\n }\n if(controlB.length === 2) {\n curve += 2;\n cx2 = originX + controlB[0] * width;\n cy2 = originY + controlB[1] * height;\n }\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n if(curve === 3) {\n ctx.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);\n }\n else if(curve === 2) {\n ctx.quadraticCurveTo(cx2, cy2, x2, y2);\n }\n else if(curve === 1) {\n ctx.quadraticCurveTo(cx1, cy1, x2, y2);\n }\n else {\n ctx.lineTo(x2, y2);\n }\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d;\n if(curve === 3) {\n d = 'M' + x1 + ',' + y1 + ' C' + cx1 + ',' + cy1 + ' ' + cx2 + ',' + cy2 + ' ' + x2 + ',' + y2;\n }\n else if(curve === 2) {\n d = 'M' + x1 + ',' + y1 + ' Q' + cx2 + ',' + cy2 + ' ' + x2 + ',' + y2;\n }\n else if(curve === 1) {\n d = 'M' + x1 + ',' + y1 + ' Q' + cx1 + ',' + cy1 + ' ' + x2 + ',' + y2;\n }\n else {\n d = 'M' + x1 + ',' + y1 + ' L' + x2 + ',' + y2;\n }\n let props = [\n ['d', d],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 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 '../util/mode';\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n this.__points = [];\n if(Array.isArray(this.props.points)) {\n this.__points = this.props.points;\n }\n // 控制点\n this.__controls = [];\n if(Array.isArray(this.props.controls)) {\n this.__controls = this.props.controls;\n }\n }\n\n __getPoints(originX, originY, width, height, points, controls) {\n let pts = [];\n let cls = [];\n let hasControl = false;\n points.forEach(item => {\n pts.push([\n originX + item[0] * width,\n originY + item[1] * height\n ]);\n });\n controls.forEach(item => {\n if(Array.isArray(item) && (item.length === 2 || item.length === 4)) {\n let arr = [];\n item.forEach((item2, i) => {\n if(i === 0 || i === 2) {\n arr.push(originX + item[i] * width);\n }\n else {\n arr.push(originY + item[i] * height);\n }\n });\n cls.push(arr);\n hasControl = true;\n }\n else {\n cls.push(null);\n }\n });\n return [pts, cls, hasControl];\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, points, controls } = this;\n let [pts, cls, hasControl] = this.__getPoints(originX, originY, width, height, points, controls);\n if(points.length < 2) {\n console.error('Points must have at lease 2 item: ' + points);\n return;\n }\n for(let i = 0, len = points.length; i < len; i++) {\n if(!Array.isArray(points[i]) || points[i].length < 2) {\n console.error('Each Point must have a coords: ' + points[i]);\n return;\n }\n }\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\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 let cl = cls[i - 1];\n if(!cl || !cl.length) {\n ctx.lineTo(point[0], point[1]);\n }\n else if(cl.length === 4) {\n ctx.bezierCurveTo(cl[0], cl[1], cl[2], cl[3], point[0], point[1]);\n }\n else {\n ctx.quadraticCurveTo(cl[0], cl[1], point[0], point[1]);\n }\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 ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n let tagName;\n if(hasControl) {\n let s = 'M' + pts[0][0] + ',' + pts[0][1];\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n let cl = cls[i - 1];\n if(!cl || !cl.length) {\n s += 'L' + point[0] + ',' + point[1];\n }\n else if(cl.length === 4) {\n s += 'C' + cl[0] + ',' + cl[1] + ' ' + cl[2] + ',' + cl[3] + ' ' + point[0] + ',' + point[1];\n }\n else {\n s += 'Q' + cl[0] + ',' + cl[1] + ' ' + point[0] + ',' + point[1];\n }\n }\n props.push(['d', s]);\n tagName = 'path';\n }\n else {\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 props.push(['points', s]);\n tagName = 'polyline';\n }\n if(strokeDasharray.length) {\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 this.addGeom(tagName, 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, controls) {\n let [pts, cls, hasControl] = super.__getPoints(originX, originY, width, height, points, controls);\n pts.push(pts[0]);\n return [pts, cls, hasControl];\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport mode from '../util/mode';\n\nconst OFFSET = Math.PI * 0.5;\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\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n this.__begin = 0;\n this.__end = 0;\n if(this.props.begin) {\n this.__begin = parseFloat(this.props.begin);\n if(isNaN(this.begin)) {\n this.__begin = 0;\n }\n }\n if(this.props.end) {\n this.__end = parseFloat(this.props.end);\n if(isNaN(this.end)) {\n this.__end = 0;\n }\n }\n // 半径0~1,默认1\n this.__r = 1;\n if(this.props.r) {\n this.__r = parseFloat(this.props.r);\n if(isNaN(this.r)) {\n this.__r = 1;\n }\n }\n // 扇形两侧是否有边\n this.__edge = false;\n if(this.props.edge !== undefined) {\n this.__edge = !!this.props.edge;\n }\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(this.props.closure !== undefined) {\n this.__closure = !!this.props.closure;\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, begin, end, r, edge, closure } = this;\n if(begin === end) {\n return;\n }\n r *= Math.min(width, height) * 0.5;\n let x1, y1, x2, y2;\n [ x1, y1 ] = getCoordsByDegree(cx, cy, r, begin);\n [ x2, y2 ] = getCoordsByDegree(cx, cy, r, end);\n let large = (end - begin) > 180 ? 1 : 0;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\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 ctx.lineTo(x1, y1);\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 ctx.lineTo(x1, y1);\n }\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(edge) {\n let props = [\n ['d', closure\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 ],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', closure\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 ],\n ['fill', fill]\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', 'M' + x1 + ',' + y1 + ' A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2],\n ['fill', 'rgba(0,0,0,0)'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('path', props);\n }\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 '../util/mode';\nimport geom from '../math/geom';\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n this.__rx = 0;\n if(this.props.rx) {\n this.__rx = parseFloat(this.props.rx);\n if(isNaN(this.rx)) {\n this.__rx = 0;\n }\n }\n this.__ry = 0;\n if(this.props.ry) {\n this.__ry = parseFloat(this.props.ry);\n if(isNaN(this.ry)) {\n this.__ry = 0;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n originX,\n originY,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, rx, ry } = this;\n rx = Math.min(rx, 0.5);\n ry = Math.min(ry, 0.5);\n rx *= width;\n ry *= height;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n if(rx === 0 && ry === 0) {\n ctx.rect(originX, originY, width, height);\n }\n else {\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n ctx.moveTo(originX + rx, originY);\n ctx.lineTo(originX + width - rx, originY);\n ctx.bezierCurveTo(originX + width + ox - rx, originY, originX + width, originY + ry - oy, originX + width, originY + ry);\n ctx.lineTo(originX + width, originY + height - ry);\n ctx.bezierCurveTo(originX + width, originY + height + oy - ry, originX + width + ox - rx, originY + height, originX + width - rx, originY + height);\n ctx.lineTo(originX + rx, originY + height);\n ctx.bezierCurveTo(originX + rx - ox, originY + height, originX, originY + height + oy - ry, originX, originY + height - ry);\n ctx.lineTo(originX, originY + ry);\n ctx.bezierCurveTo(originX, originY + ry - oy, originX + rx - ox, originY, originX + rx, originY);\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 ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(rx) {\n props.push(['rx', rx]);\n }\n if(ry) {\n props.push(['ry', ry]);\n }\n if(strokeDasharray.length) {\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 this.addGeom('rect', 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 '../util/mode';\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n this.__r = 1;\n if(this.props.r) {\n this.__r = parseFloat(this.props.r);\n if(isNaN(this.r)) {\n this.__r = 1;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, r } = this;\n r *= Math.min(width, height) * 0.5;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n ctx.arc(cx, cy, r, 0, 2 * Math.PI);\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 ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('circle', 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 '../util/mode';\nimport geom from '../math/geom';\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n this.__rx = 1;\n if(this.props.rx) {\n this.__rx = parseFloat(this.props.rx);\n if(isNaN(this.rx)) {\n this.__rx = 1;\n }\n }\n this.__ry = 1;\n if(this.props.ry) {\n this.__ry = parseFloat(this.props.ry);\n if(isNaN(this.ry)) {\n this.__ry = 1;\n }\n }\n }\n\n render(renderMode, ctx, defs) {\n let {\n isDestroyed,\n cx,\n cy,\n display,\n visibility,\n fill,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n } = super.render(renderMode, ctx, defs);\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return;\n }\n let { width, height, rx, ry } = this;\n rx *= width * 0.5;\n ry *= height * 0.5;\n if(renderMode === mode.CANVAS) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.lineCap = strokeLinecap;\n ctx.lineJoin = strokeLinejoin;\n ctx.miterLimit = strokeMiterlimit;\n ctx.setLineDash(strokeDasharray);\n ctx.beginPath();\n if(ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, 0, 0, 2 * Math.PI);\n }\n else {\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n ctx.moveTo(cx - rx, cy);\n ctx.bezierCurveTo(cx - rx, cy - oy, cx - ox, cy - ry, cx, cy - ry);\n ctx.bezierCurveTo(cx + ox, cy - ry, cx + rx, cy - oy, cx + rx, cy);\n ctx.bezierCurveTo(cx + rx, cy + oy, cx + ox, cy + ry, cx, cy + ry);\n ctx.bezierCurveTo(cx - ox, cy + ry, cx - rx, cy + oy, cx - rx, cy);\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 ['cx', cx],\n ['cy', cy],\n ['rx', rx],\n ['ry', ry],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(strokeDasharray.length) {\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 this.addGeom('ellipse', 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};\n\nlet abbrCssProperty = {\n os: 'offset',\n e: 'easing',\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.concat(reset.geom).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 util from './util';\nimport abbr from './abbr';\nimport Node from '../node/Node';\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 let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值\n if(v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isNil(v)) {\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 id: ' + libraryId);\n }\n }\n });\n }\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + id);\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 = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + 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 => {\n return parse(karas, item, animateRecords, vars, hash);\n }));\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 Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport mode from './util/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 parse from './util/parse';\nimport inject from './util/inject';\nimport abbr from './util/abbr';\nimport css from './style/css';\nimport unit from './style/unit';\nimport reset from './style/reset';\nimport frame from './animate/frame';\nimport easing from './animate/easing';\nimport level from './animate/level';\nimport math from './math/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 createVd(tagName, props, children) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(Dom.isValid(tagName)) {\n if(tagName === 'img') {\n return new Img(tagName, props);\n }\n return new Dom(tagName, props, children);\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n let klass = Geom.getRegister(tagName);\n return new klass(tagName, props);\n },\n createCp(cp, props, children) {\n return new cp(props, children);\n },\n parse(json, dom, options = {}) {\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(this, 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 = vd.animateController;\n ac.__records = animateRecords;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n this.render(vd, dom);\n // 总控次数、速度\n ac.__op(options);\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(!options.hasOwnProperty('autoPlay') || options.autoPlay) {\n ac.play();\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = animateRecords;\n }\n }\n return vd;\n },\n Root,\n Dom,\n Img,\n Geom,\n mode,\n Component,\n Event,\n util,\n inject,\n css,\n unit,\n reset,\n abbr,\n frame,\n easing,\n level,\n math,\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","toString","isType","type","obj","call","joinSourceArray","arr","res","i","len","length","item","Array","isArray","stringify","s","isNil","encodeHtml","prop","replace","v","undefined","joinVirtualDom","vd","defs","forEach","joinDef","bbMask","bb","joinVd","conMask","children","isMask","props","tagName","content","opacity","transform","mask","filter","def","uuid","joinItem","rgba2int","color","charAt","slice","push","parseInt","c","match","parseFloat","int2rgba","joinArr","arr2hash","hash","list","Object","keys","j","k","hash2arr","clone","util","isDate","Date","n","equalArr","a","b","ai","bi","isArrayA","isArrayB","extend","target","source","split","isObject","isString","isFunction","isNumber","isBoolean","isPrimitive","init","root","host","ref","CANVAS","SVG","DOM","position","display","top","right","bottom","left","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","width","height","flexGrow","flexShrink","flexBasis","flexDirection","justifyContent","alignItems","textAlign","transformOrigin","visibility","zIndex","translateX","translateY","scaleX","scaleY","skewX","skewY","rotateZ","GEOM","fill","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","dom","domKey","geom","geomKey","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","identity","multiply","calPoint","point","m","vectorProduct","x1","y1","x2","y2","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","Math","max","min","transformPoint","matrix","d","e","f","angleBySide","theta","pow","acos","pointsDistance","sqrt","triangleIncentre","x3","y3","d2r","PI","r2d","H","h","deg","cos","sin","calDeg","dx","dy","atan","abs","rotate","t","pointIndex","points","index","cross","pointByIndex","exchangeOrder","sx1","sy1","sx2","sy2","sx3","sy3","tx1","ty1","tx2","ty2","tx3","ty3","isOverflow","cross1","cross2","ls","lt","scale","alpha","ax1","ay1","ax2","ay2","ax3","ay3","ab","ac","bc","AB","AC","BC","A","tan","tar","unit","math","calSingle","calMatrix","ow","oh","normalize","calMatrixByOrigin","t2","calMatrixWithOrigin","pointInQuadrilateral","x4","y4","normalizeSingle","value","calOrigin","w","tfo","gradient","img","getLinearDeg","exec","getRadialPosition","data","test","center","getColorStop","p","start","end","num","per","prev","splice","allBefore","allAfter","first","last","getCsLimit","next","c1","c2","getCsStartLimit","getCsEndLimit","calLinearCoords","cx","cy","x0","y0","r","calRadialRadius","shape","size","iw","ih","xl","yl","p1","p2","r1","g1","b1","a1","r2","g2","b2","a2","l1","l2","floor","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","controls1","controls2","calBezierTopLeft","concat","pop","endLength","oyr","calBezierTopRight","sx","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","xa","xb","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","DEFAULT_FONT_SIZE","parserOneBorder","parseFlex","grow","shrink","basis","parseMarginPadding","key","temp","calUnit","compatibleTransform","reset","border","borderColor","borderRadius","background","gd","repeat","bgc","backgroundPosition","flex","console","error","hasOwnProperty","translate","skew","arr1","arr2","isNaN","blur","compute","node","isRoot","animateStyle","currentStyle","__currentStyle","computedStyle","__computedStyle","parentComputedStyle","parent","calNormalLineHeight","repaint","setFontStyle","getBaseLine","normal","font","calRelativePercent","calRelative","isWidth","calAbsolute","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","LineBox","__content","renderMode","ctx","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","begin","count","maxW","lineBox","__offsetX","__offsetY","render","textWidth","__layout","fillStyle","virtualDom","baseLine","Event","__eHash","id","handle","self","on","cb","apply","off","__karasEventCb","once","emit","event","fns","fn","REPAINT","REFLOW","controlA","controlB","rx","ry","controls","STYLE","Component","constructor","__tagName","__props","__children","__ref","__state","__isMount","state","delRefreshTask","__task","ovd","shadowRoot","before","__init","setRefreshLevel","level","after","__destroy","addRefreshTask","sr","listener","__shadowRoot","tool","__create","componentWillUnmount","force","__emitEvent","componentDidMount","REFRESH","__measure","__repaint","defineProperty","prototype","get","arguments","SPF","cacheCanvas","document","createElement","body","append","setAttribute","canvas","getContext","draw","IMG","INIT","LOADING","LOADED","inject","html","chars","inline","div","appendChild","innerHTML","cns","childNodes","window","getComputedStyle","text","__measureCb","removeChild","measureImg","url","task","Image","onload","success","onerror","substr","location","hostname","crossOrigin","src","warn","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","clearTimeout","now","performance","getCacheCanvas","getMaskCanvas","isDom","Element","getElementsByTagName","traversal","step","Frame","__hookTask","__now","__karasFramecb","offFrame","onFrame","__aTask","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","Float32Array","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","linear","easeIn","easeOut","ease","easeInOut","cubicBezier","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","radial","KEY_EXPAND","EXPAND_HASH","unify","frames","currentProps","inherit","outerWidth","outerHeight","tf","equalStyle","av","bv","isStyleReflow","calRefresh","frameStyle","lastStyle","lv","genBeforeRefresh","animation","__frameHook","__style","framing","duration","es","offset","time","transition","calDiff","pm","nm","pi","ni","pv","nv","innerWidth","eq","pp","np","len2","calFrame","ts","binarySearch","frame","middle","getEasing","ea","timingFunction","steps","stepsD","percent","ceil","calIntermediateStyle","st","gotoOverload","options","Animation","__id","__target","__list","nl","__options","op","__duration","delay","endDelay","iterations","fps","playbackRate","__easing","playCount","spfLimit","__frames","__framesR","__startTime","currentTime","__nextTime","__fpsTime","__playState","current","unshift","copy","__keys","framesR","reverse","__clean","isFinish","__cancelTask","__currentTime","__playCount","__stayEnd","__fin","__begin","__end","__isDelay","__finish","__inFps","__enterFrame","FINISH","__frameCb","isDelay","FRAME","__firstPlay","PLAY","__playCb","playState","firstEnter","stayEnd","stayBegin","__stayBegin","enterFrame","__calDiffTime","needRefresh","currentFrames","alternate","isEven","isLastFrame","isLastCount","inEndDelay","__nextBegin","BEGIN","END","pending","PAUSE","play","nextFrame","CANCEL","__goto","isFrame","excludeDelay","finish","spf","animateController","add","remove","backwards","both","forwards","removeControl","__delay","__endDelay","__fps","__iterations","Infinity","__fill","__direction","__playbackRate","__spfLimit","genCanvasPolygon","beginPath","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","closePath","genSvgPolygon","renderBorder","xom","renderBgc","rect","borderRadiusKs","calBorderRadius","noRadius","half","calBackgroundSize","calBackgroundPosition","container","Xom","__listener","__animationList","__loadBgi","__mpWidth","mp","fromAbs","__mp","__layoutBlock","__layoutFlex","__layoutInline","ar","__animateRecords","__records","records","w2","h2","fixedWidth","fixedHeight","innerHeight","sy","globalAlpha","__matrix","isScale","renderMatrix","matrixEvent","mx","__matrixEvent","setTransform","loadBgi","bgX","bgY","needMask","xnl","xnr","ynt","ynb","currentCtx","drawImage","globalCompositeOperation","clearRect","image","needResize","maskId","bgi","__gradient","hasMask","owner","animationList","__stopPropagation","isGeom","zIndexChildren","childWillResponse","child","__touchstartTarget","__stopImmediatePropagation","willResponseEvent","__hasEmitted","inThis","vs","__getLg","__getRg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","underControl","autoPlay","cancel","animating","LineGroup","__calBaseLine","TAG_NAME","INLINE","isRelativeOrAbsolute","flatten","traverse","lastText","Dom","__lineGroups","block","none","flowChildren","__tryLayInline","isDirectionRow","isRecursion","main","__calAutoBasis","min2","max2","__calMp","lineGroups","__preLayout","cw","lineGroup","fw","verticalAlign","horizonAlign","__marginAuto","maxX","growList","shrinkList","basisList","minList","growSum","shrinkSum","basisSum","maxSum","maxCross","overflow","between","around","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__layoutAbs","__renderAsMask","__renderByMask","noAbs","__iIndex","isXom","__iXom","isAbs","__iAbs","sort","Img","loadImg","__loadImg","originX","originY","pts","strokeStyle","lineWidth","arc","__addGeom","elem","nvd","diffDefs","diffBb","diffD2D","od","nd","ol","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffChild","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","firstChild","lastChild","obb","nbb","oMask","nMask","isText","svg","where","insertBefore","Defs","LIST","replaceOption","globalValue","vars","decl","replaceGlobal","global","Controller","record","animate","args","__action","__set","getDom","querySelector","renderProp","initEvent","addEventListener","__cb","Root","__node","__mw","__mh","__animateController","mix","getBoundingClientRect","touches","pageX","pageY","stopPropagation","stopImmediatePropagation","preventDefault","__initProps","__refreshLevel","nodeName","toUpperCase","__genHtml","__uuid","__defs","getInstance","getPropertyValue","__ctx","__renderMode","refresh","clear","__clear","__vd","__rTask","hookTask","REGISTER","Geom","__isMask","__currentProps","strokeDasharrayStr","animateProps","__preRender","xi","yi","$0","$1","$2","__maskId","name","hasRegister","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","curve","lineCap","lineJoin","miterLimit","setLineDash","addGeom","getProps","Polyline","__points","__controls","cls","hasControl","item2","__getPoints","cl","Polygon","OFFSET","getCoordsByDegree","Sector","__r","__edge","edge","__closure","closure","large","Rect","__rx","__ry","Circle","Ellipse","ellipse","fullCssProperty","abbrCssProperty","os","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr","abbr2full","k2","fk","replaceVars","join","linkLibrary","libraryId","libraryItem","linkChild","parse","karas","json","animateRecords","library","createGm","createVd","animationRecord","has","register","version","appendTo","isValid","klass","getRegister","createCp","cp","__op"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A0B;EACxBa,UAAAA,EAAE,CAAC83B,gBAAH,GAAsB+R,cAAtB;EACD;EACF;;EACD,WAAO7pC,EAAP;EACD,GAhES;EAiEVsjC,EAAAA,IAAI,EAAJA,IAjEU;EAkEVrH,EAAAA,GAAG,EAAHA,GAlEU;EAmEVsD,EAAAA,GAAG,EAAHA,GAnEU;EAoEV8F,EAAAA,IAAI,EAAJA,IApEU;EAqEV5lB,EAAAA,IAAI,EAAJA,IArEU;EAsEVwD,EAAAA,SAAS,EAATA,SAtEU;EAuEVvB,EAAAA,KAAK,EAALA,KAvEU;EAwEVlf,EAAAA,IAAI,EAAJA,IAxEU;EAyEV2jB,EAAAA,MAAM,EAANA,MAzEU;EA0EV3G,EAAAA,GAAG,EAAHA,GA1EU;EA2EV5Q,EAAAA,IAAI,EAAJA,IA3EU;EA4EV4N,EAAAA,KAAK,EAALA,KA5EU;EA6EVwsB,EAAAA,IAAI,EAAJA,IA7EU;EA8EV1Z,EAAAA,KAAK,EAALA,KA9EU;EA+EV3D,EAAAA,MAAM,EAANA,MA/EU;EAgFV1H,EAAAA,KAAK,EAALA,KAhFU;EAiFVpV,EAAAA,IAAI,EAAJA;EAjFU,CAAZ;;EAoFA,IAAG,OAAO+X,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAAC+iB,KAAP,GAAeA,KAAf;EACD;;;;;;;;"} \ No newline at end of file diff --git a/src/node/Text.js b/src/node/Text.js index e68b056a9..3512bc935 100644 --- a/src/node/Text.js +++ b/src/node/Text.js @@ -203,7 +203,11 @@ class Text extends Node { } render(renderMode, ctx) { - const { isDestroyed, computedStyle } = this; + let vd = this.__virtualDom = { + type: 'text', + children: [], + }; + const { isDestroyed, computedStyle, lineBoxes } = this; if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') { return; } @@ -211,14 +215,11 @@ class Text extends Node { ctx.font = css.setFontStyle(computedStyle); ctx.fillStyle = util.int2rgba(computedStyle.color); } - this.lineBoxes.forEach(item => { + lineBoxes.forEach(item => { item.render(renderMode, ctx, computedStyle); }); if(renderMode === mode.SVG) { - this.__virtualDom = { - type: 'text', - children: this.lineBoxes.map(lineBox => lineBox.virtualDom), - }; + vd.children = lineBoxes.map(lineBox => lineBox.virtualDom); } } diff --git a/test/visibility-hidden-inherit-child-svg/test.js b/test/visibility-hidden-inherit-child-svg/test.js index 6e3451880..c53764758 100644 --- a/test/visibility-hidden-inherit-child-svg/test.js +++ b/test/visibility-hidden-inherit-child-svg/test.js @@ -6,7 +6,7 @@ module.exports = { browser .url('file://' + path.join(__dirname, 'index.html')) .waitForElementVisible('body', 1000) - .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{},{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",8.90625],["y",14.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"2"}]}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[]}visible') + .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[]},{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",8.90625],["y",14.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"2"}]}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[]}visible') .end(); } }; diff --git a/test/visibility-hidden-inherit-geom-svg/test.js b/test/visibility-hidden-inherit-geom-svg/test.js index 36ef2293d..b7e465337 100644 --- a/test/visibility-hidden-inherit-geom-svg/test.js +++ b/test/visibility-hidden-inherit-geom-svg/test.js @@ -6,7 +6,7 @@ module.exports = { browser .url('file://' + path.join(__dirname, 'index.html')) .waitForElementVisible('body', 1000) - .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{},{"bb":[],"children":[],"opacity":1,"type":"geom"}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[]}hidden') + .assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[]},{"bb":[],"children":[],"opacity":1,"type":"geom"}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[]}hidden') .end(); } };