From c977b813118e7af282af6dc38d6ba7382163c977 Mon Sep 17 00:00:00 2001 From: army8735 Date: Wed, 4 Nov 2020 12:09:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8A=A8=E7=94=BB=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=8B=B7=E8=B4=9D=E4=BC=98=E5=8C=96=20#104?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 74 +++++++++++++++++++++++++++++++--------- index.js.map | 2 +- src/animate/Animation.js | 2 +- src/style/css.js | 41 ++++++++++++++++++++++ 4 files changed, 101 insertions(+), 18 deletions(-) diff --git a/index.js b/index.js index 7e33c219a..38c493df0 100644 --- a/index.js +++ b/index.js @@ -3892,7 +3892,7 @@ // border-width不支持百分比 computedStyle[k] = currentStyle[k].unit === PX$1 ? Math.max(0, currentStyle[k].value) : 0; }); - ['position', 'display', 'flexDirection', 'justifyContent', 'alignItems', 'flexGrow', 'flexShrink'].forEach(function (k) { + ['position', 'display', 'flexDirection', 'justifyContent', 'alignItems', 'alignSelf', 'flexGrow', 'flexShrink'].forEach(function (k) { computedStyle[k] = currentStyle[k]; }); @@ -4090,6 +4090,47 @@ return position === 'relative' || position === 'absolute'; } + var direct = { + position: true, + display: true, + backgroundSize: true, + backgroundRepeat: true, + borderTopStyle: true, + borderRightStyle: true, + borderBottomStyle: true, + borderLeftStyle: true, + flexDirection: true, + justifyContent: true, + alignItems: true, + alignSelf: true, + flexGrow: true, + flexShrink: true, + strokeLinecap: true, + strokeLinejoin: true, + strokeMiterlimit: true, + fillRule: true + }; + + function clone$1(style) { + var res = {}; + + for (var k in style) { + if (style.hasOwnProperty(k)) { + var v = style[k]; + + if (direct.hasOwnProperty(k)) { + res[k] = v; + } else if (k === 'filter' || k === 'transform' || k === 'strokeDasharray') { + res[k] = util.extend({}, v); + } else { + res[k] = util.extend({}, v, ['value', 'unit']); + } + } + } + + return res; + } + var css = { normalize: normalize, computeMeasure: computeMeasure, @@ -4099,7 +4140,8 @@ calRelative: calRelative, calAbsolute: calAbsolute, equalStyle: equalStyle, - isRelativeOrAbsolute: isRelativeOrAbsolute + isRelativeOrAbsolute: isRelativeOrAbsolute, + clone: clone$1 }; var LineBox = /*#__PURE__*/function () { @@ -8595,7 +8637,7 @@ isFunction$3 = util.isFunction, isNumber$1 = util.isNumber, isObject$1 = util.isObject, - clone$1 = util.clone, + clone$2 = util.clone, equalArr$1 = util.equalArr; var linear = easing.linear; var COLOR_HASH$2 = key.COLOR_HASH, @@ -9294,7 +9336,7 @@ function calIntermediateStyle(frame, percent, target) { - var style = clone$1(frame.style); + var style = css.clone(frame.style); var timingFunction = getEasing(frame.easing); if (timingFunction && timingFunction !== linear) { @@ -9502,7 +9544,7 @@ _this.__id = uuid++; _this.__target = target; _this.__root = target.root; - list = clone$1(list || []); + list = clone$2(list || []); if (Array.isArray(list)) { _this.__list = list.filter(function (item) { @@ -9634,21 +9676,21 @@ if (list.length === 1) { - list[0] = clone$1(list[0]); + list[0] = clone$2(list[0]); if (list[0].offset === 1) { list.unshift({ offset: 0 }); } else { - var copy = clone$1(list[0]); + var copy = clone$2(list[0]); copy.offset = 1; list.push(copy); } } // 强制clone防止同引用 else { list.forEach(function (item, i) { - list[i] = clone$1(item); + list[i] = clone$2(item); }); } // 首尾时间偏移强制为[0, 1],不是的话前后加空帧 @@ -9734,7 +9776,7 @@ } // 反向存储帧的倒排结果 - var framesR = clone$1(frames).reverse(); + var framesR = clone$2(frames).reverse(); framesR.forEach(function (item) { item.time = duration - item.time; item.transition = []; @@ -11333,7 +11375,7 @@ PERCENT$5 = unit.PERCENT, STRING$2 = unit.STRING, INHERIT$3 = unit.INHERIT; - var clone$2 = util.clone, + var clone$3 = util.clone, int2rgba$2 = util.int2rgba, rgba2int$3 = util.rgba2int, equalArr$2 = util.equalArr, @@ -11886,7 +11928,7 @@ return; } - this.__layoutData = clone$2(data); // margin/padding在abs前已经计算过了,无需二次计算 + this.__layoutData = clone$3(data); // margin/padding在abs前已经计算过了,无需二次计算 if (!fromAbs) { this.__mp(currentStyle, computedStyle, w); @@ -13114,7 +13156,7 @@ }); // 再画重复的十字和4角象限 repeat.forEach(function (item) { - var copy = clone$2(props); + var copy = clone$3(props); if (needResize) { var _matrix3 = image.matrixResize(_width2, _height2, w, h, item[0], item[1], innerWidth, innerHeight); @@ -14454,7 +14496,7 @@ var isNil$5 = util.isNil, isFunction$4 = util.isFunction, - clone$3 = util.clone, + clone$4 = util.clone, extend$2 = util.extend; /** * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归 @@ -14520,7 +14562,7 @@ return; } - var state = clone$3(self.state); + var state = clone$4(self.state); n = extend$2(state, n); } @@ -23180,7 +23222,7 @@ var isNil$e = util.isNil, isFunction$7 = util.isFunction, isPrimitive = util.isPrimitive, - clone$4 = util.clone, + clone$5 = util.clone, extend$3 = util.extend; var abbrCssProperty$1 = abbr$1.abbrCssProperty, abbrAnimateOption$1 = abbr$1.abbrAnimateOption, @@ -23308,7 +23350,7 @@ function linkChild(child, libraryItem) { // 规定图层child只有init和动画,属性和子图层来自库 child.tagName = libraryItem.tagName; - child.props = clone$4(libraryItem.props); + child.props = clone$5(libraryItem.props); child.children = libraryItem.children; // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况 Object.keys(libraryItem).forEach(function (k) { diff --git a/index.js.map b/index.js.map index 6b74c46eb..3ee63fda3 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/util/$$type.js","src/math/matrix.js","src/util/util.js","src/style/reg.js","src/math/geom.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/LineBox.js","src/node/Text.js","src/util/painter.js","src/math/tar.js","src/math/index.js","src/style/transform.js","src/style/border.js","src/style/image.js","src/style/blur.js","src/util/inject.js","src/util/Event.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/refresh/level.js","src/refresh/Page.js","src/refresh/Cache.js","src/node/Xom.js","src/node/LineGroup.js","src/node/tag.js","src/util/builder.js","src/node/Component.js","src/refresh/mode.js","src/geom/Geom.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/node/Root.js","src/geom/Line.js","src/geom/Polyline.js","src/geom/Polygon.js","src/geom/Sector.js","src/geom/Rect.js","src/geom/Circle.js","src/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/index.js","src/index.js"],"sourcesContent":["class Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n // 默认undefined\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 get domParent() {\n if(this.__domParent !== undefined) {\n return this.__domParent;\n }\n let p = this;\n let root = this.root;\n while(p) {\n if(p === root) {\n p = undefined;\n break;\n }\n if(p.parent) {\n p = p.parent;\n break;\n }\n if(p.host) {\n p = p.host;\n }\n }\n return this.__domParent = p || null;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n};\n","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","'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","// 类型为引用防止json仿造\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","// 生成3*3单位矩阵,css表达方法一维6位\nfunction identity() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n// 矩阵a*b,固定两个matrix都是长度6\nfunction multiply(a, b) {\n // 特殊情况优化\n let isPreIdA = a[0] === 1 && a[1] === 0 && a[2] === 0 && a[3] === 1;\n let isPreIdB = b[0] === 1 && b[1] === 0 && b[2] === 0 && b[3] === 1;\n let isSubIdA = a[4] === 0 && a[5] === 0;\n let isSubIdB = b[4] === 0 && b[5] === 0;\n if(isPreIdA && isSubIdA) {\n return b.slice(0);\n }\n if(isPreIdB && isSubIdB) {\n return a.slice(0);\n }\n if(isPreIdA && isPreIdB) {\n a = a.slice(0);\n a[4] += b[4];\n a[5] += b[5];\n return a;\n }\n else if(isPreIdA || isPreIdB) {\n let c = isPreIdA ? b.slice(0) : a.slice(0);\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n return c;\n }\n let c = [\n a[0] * b[0] + a[2] * b[1],\n a[1] * b[0] + a[3] * b[1],\n a[0] * b[2] + a[2] * b[3],\n a[1] * b[2] + a[3] * b[3],\n 0,\n 0,\n ];\n if(isSubIdA && isSubIdB) {\n }\n else if(isSubIdB) {\n c[4] = a[4];\n c[5] = a[5];\n }\n else {\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y] = point;\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n}\n\nfunction int2convolution(v) {\n let d = Math.floor(v * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n d *= 3;\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * @param m\n */\nfunction inverse(m) {\n let [a, b, c, d, e, f] = m;\n if(a === 1 && b === 0 && c === 0 && d === 1 && e === 0 && f === 0) {\n return m;\n }\n let ar = 1;\n let br = 0;\n let cr = 0;\n let dr = 1;\n let er = 0;\n let fr = 0;\n // 先检查a是否为0,强制a为1\n if(a === 0) {\n if(b === 1) {\n [a, b, c, d, e, f, ar, br, cr, dr, er, fr] = [b, a, d, c, f, e, br, ar, dr, cr, fr, er];\n }\n else if(b === 0) {\n return [0, 0, 0, 0, 0, 0];\n }\n // R1 + R2/b\n else {\n a = 1;\n c += c / b;\n e += e / b;\n ar += ar / b;\n cr += cr / b;\n er += er / b;\n b = 0;\n }\n }\n // b/a=x,R2-R1*x,b为0可优化\n if(b !== 0) {\n let x = b / a;\n b = 0;\n d -= c * x;\n f -= e * x;\n br -= ar * x;\n dr -= cr * x;\n fr -= er * x;\n }\n // R1/a,a为0或1可优化\n if(a !== 1) {\n c /= a;\n e /= a;\n ar /= a;\n cr /= a;\n er /= a;\n a = 1;\n }\n // c/d=y,R1-R2*y,c为0可优化\n if(c !== 0) {\n let y = c / d;\n c = 0;\n e -= f * y;\n ar -= br * y;\n cr -= dr * y;\n er -= fr * y;\n }\n // 检查d是否为0,如果为0转成1,R2+1-R1\n if(d === 0) {\n d = 1;\n f += 1 - e;\n br += 1 - ar;\n dr += 1 - cr;\n fr += 1 - er;\n }\n // R2/d,d为1可优化\n else if(d !== 1) {\n f /= d;\n br /= d;\n dr /= d;\n fr /= d;\n d = 1;\n }\n // R1-R3*e,R2-R3*f,e/f为0可优化\n if(e !== 0) {\n er -= e;\n e = 0;\n }\n if(f !== 0) {\n fr -= f;\n f = 0;\n }\n return [ar, br, cr, dr, er, fr];\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n int2convolution,\n inverse,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, clip, filter } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n }\n else {\n res[0] = res[1] = res[2] = 0;\n }\n res[3] = 1;\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__target = nvd;\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(!equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n [x1, y1] = mx.calPoint([x1, y1], matrix);\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y] = mx.calPoint([x, y], matrix);\n xa = Math.min(xa, x);\n xb = Math.max(xa, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n return bbox;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n};\n\nexport default util;\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 mx from './matrix';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\n\n// 向量积\nfunction vectorProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(vectorProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y]\n ];\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { width, height, transformOrigin: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = mx.calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { width, height, transformOrigin: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - x * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return [x0, y0, x1, y1];\n }\n if(arguments.length === 6) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n if(arguments.length === 8) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\n/**\n * 范数 or 模\n */\nfunction norm(v) {\n let order = v.length;\n let sum = v.reduce((a, b) => Math.pow(a, order) + Math.pow(b, order));\n return Math.pow(sum, 1 / order);\n}\n\nfunction simpson38(derivativeFunc, l, r) {\n let f = derivativeFunc;\n let middleL = (2 * l + r) / 3;\n let middleR = (l + 2 * r) / 3;\n return (f(l) + 3 * f(middleL) + 3 * f(middleR) + f(r)) * (r - l) / 8;\n}\n\n/**\n * bezier 曲线的长度\n * @param derivativeFunc 微分函数\n * @param l 左点\n * @param r 右点\n * @param eps 精度\n * @return {*} number\n */\nfunction adaptiveSimpson38(derivativeFunc, l, r, eps = 0.001) {\n let f = derivativeFunc;\n let mid = (l + r) / 2;\n let st = simpson38(f, l, r);\n let sl = simpson38(f, l, mid);\n let sr = simpson38(f, mid, r);\n let ans = sl + sr - st;\n if(Math.abs(ans) <= 15 * eps) {\n return sl + sr + ans / 15;\n }\n return adaptiveSimpson38(f, l, mid, eps / 2) + adaptiveSimpson38(f, mid, r, eps / 2);\n}\n\n/**\n * bezier 曲线的长度\n * @param points 曲线的起止点 和 控制点\n * @param order 阶次, 2 和 3\n * @param startT 计算长度的起点,满足 0 <= startT <= endT <= 1\n * @param endT 计算长度的终点\n * @return {*} number\n */\nfunction bezierLength(points, order, startT = 0, endT = 1) {\n let derivativeFunc = t => norm(at(t, points, order));\n return adaptiveSimpson38(derivativeFunc, startT, endT);\n}\n\n/**\n * 3 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at3(t, points, order = 1) {\n let [p0, p1, p2, p3] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let [x3, y3] = p3;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 3) * x0 + 3 * t * Math.pow((1 - t), 2) * x1 + 3 * (1 - t) * Math.pow(t, 2) * x2 + Math.pow(t, 3) * x3;\n y = Math.pow((1 - t), 3) * y0 + 3 * t * Math.pow((1 - t), 2) * y1 + 3 * (1 - t) * Math.pow(t, 2) * y2 + Math.pow(t, 3) * y3;\n }\n else if(order === 1) {\n x = 3 * ((1 - t) * (1 - t) * (x1 - x0) + 2 * (1 - t) * t * (x2 - x1) + t * t * (x3 - x2));\n y = 3 * ((1 - t) * (1 - t) * (y1 - y0) + 2 * (1 - t) * t * (y2 - y1) + t * t * (y3 - y2));\n }\n else if(order === 2) {\n x = 6 * (x2 - 2 * x1 + x0) * (1 - t) + 6 * (x3 - 2 * x2 + x1) * t;\n y = 6 * (y2 - 2 * y1 + y0) * (1 - t) + 6 * (y3 - 2 * y2 + y1) * t;\n }\n else if(order === 3) {\n x = 6 * (x3 - 3 * x2 + 3 * x1 - x0);\n y = 6 * (y3 - 3 * y2 + 3 * y1 - y0);\n }\n else {\n // 3阶导数就是常数了,大于3阶的都是0\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * 2 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at2(t, points, order = 1) {\n let [p0, p1, p2] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 2) * x0 + 2 * t * (1 - t) * x1 + Math.pow(t, 2) * x2;\n y = Math.pow((1 - t), 2) * y0 + 2 * t * (1 - t) * y1 + Math.pow(t, 2) * y2;\n }\n else if(order === 1) {\n x = 2 * (1 - t) * (x1 - x0) + 2 * t * (x2 - x1);\n y = 2 * (1 - t) * (y1 - y0) + 2 * t * (y2 - y1);\n }\n else if(order === 2) {\n x = 2 * (x2 - 2 * x1 + x0);\n y = 2 * (y2 - 2 * y1 + y0);\n }\n else {\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\nfunction at(t, points, bezierOrder, derivativeOrder = 1) {\n if(bezierOrder === 2) {\n return at2(t, points, derivativeOrder);\n }\n else if(bezierOrder === 3) {\n return at3(t, points, derivativeOrder);\n }\n}\n\nfunction pointAtBezier(points, order, percent, maxIteration, eps) {\n let length = bezierLength(points, order, 0, 1);\n return pointAtBezierWithLength(points, order, length, percent, maxIteration, eps);\n}\n\nfunction pointAtBezierWithLength(points, order, length, percent = 1, maxIteration = 20, eps = 0.001) {\n let derivativeFunc = t => norm(at(t, points, order));\n let targetLen = length * percent;\n let approachLen = length;\n let approachT = percent;\n let preApproachT = approachT;\n for(let i = 0; i < maxIteration; i++) {\n approachLen = simpson38(derivativeFunc, 0, approachT);\n let d = approachLen - targetLen;\n if(Math.abs(d) < eps) {\n break;\n }\n // Newton 法\n let derivative1 = norm(at(approachT, points, order, 1)); // 1 阶导数\n let derivative2 = norm(at(approachT, points, order, 2)); // 2 阶导数\n let numerator = d * derivative1;\n let denominator = d * derivative2 + derivative1 * derivative1;\n approachT = approachT - numerator / denominator;\n if(Math.abs(approachT - preApproachT) < eps) {\n break;\n }\n else {\n preApproachT = approachT;\n }\n }\n return at(approachT, points, order, 0);\n}\n\nfunction sliceBezier(points, t) {\n let [[x1, y1], [x2, y2], [x3, y3], p4] = points;\n let x12 = (x2 - x1) * t + x1;\n let y12 = (y2 - y1) * t + y1;\n let x23 = (x3 - x2) * t + x2;\n let y23 = (y3 - y2) * t + y2;\n let x123 = (x23 - x12) * t + x12;\n let y123 = (y23 - y12) * t + y12;\n if(points.length === 4) {\n let [x4, y4] = p4;\n let x34 = (x4 - x3) * t + x3;\n let y34 = (y4 - y3) * t + y3;\n let x234 = (x34 - x23) * t + x23;\n let y234 = (y34 - y23) * t + y23;\n let x1234 = (x234 - x123) * t + x123;\n let y1234 = (y234 - y123) * t + y123;\n return [[x1, y1], [x12, y12], [x123, y123], [x1234, y1234]];\n }\n else if(points.length === 3) {\n return [[x1, y1], [x12, y12], [x123, y123]];\n }\n}\n\nfunction sliceBezier2Both(points, start = 0, end = 1) {\n start = Math.max(start, 0);\n end = Math.min(end, 1);\n if(start === 0 && end === 1) {\n return points;\n }\n if(end < 1) {\n points = sliceBezier(points, end);\n }\n if(start > 0) {\n if(end < 1) {\n start = start / end;\n }\n points = sliceBezier(points.reverse(), (1 - start)).reverse();\n }\n return points;\n}\n\nexport default {\n vectorProduct,\n pointInPolygon,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n },\n angleBySide,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n bezierLength,\n pointAtBezier,\n pointAtBezierWithLength,\n sliceBezier,\n sliceBezier2Both,\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","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'normal',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'stretch',\n alignSelf: 'auto',\n textAlign: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n scaleX: 1,\n scaleY: 1,\n skewX: 0,\n skewY: 0,\n rotateZ: 0,\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(temp) {\n let match = temp.toString().match(/(-?[\\d.]+(px|%)?)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+px\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,6}/i.exec(v);\n if(c && [4, 7].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderWidthTop', 'borderWidthRight', 'borderWidthBottom', 'borderWidthLeft'],\n borderColor: ['borderColorTop', 'borderColorRight', 'borderColorBottom', 'borderColorLeft'],\n borderStyle: ['borderStyleTop', 'borderStyleRight', 'borderStyleBottom', 'borderStyleLeft'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundRepeat: ['backgroundRepeatX', 'backgroundRepeatY'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-)?repeat(-[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n this.toFull(style, 'backgroundRepeat');\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, Math.max(0, parseFloat(v)), 1, 0);\n }\n else if(/^[\\d.]+px$/i.test(v)) {\n parseFlex(style, 1, 1, 0);\n }\n else if(/^[\\d.]+%$/.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], arr[1], 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+%$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], 1, arr[1]);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n v = v.toString().split(/\\s+/);\n if(v.length === 1) {\n v[1] = '50%';\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[i];\n }\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n }\n};\n","const KEY_COLOR = [\n 'backgroundColor',\n 'borderBottomColor',\n 'borderLeftColor',\n 'borderRightColor',\n 'borderTopColor',\n 'color',\n];\n\nconst KEY_LENGTH = [\n 'fontSize',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'bottom',\n 'left',\n 'right',\n 'top',\n 'flexBasis',\n 'width',\n 'height',\n 'lineHeight',\n 'marginBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'strokeWidth',\n 'strokeMiterlimit',\n];\n\nconst KEY_GRADIENT = [\n 'backgroundImage',\n 'fill',\n 'stroke',\n];\n\nconst KEY_RADIUS = [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n};\n\nconst KEY_EXPAND = [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'rotateZ',\n 'skewX',\n 'skewY'\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\n\nlet o = {\n GEOM: {\n },\n IGNORE: {\n pointerEvents: true,\n },\n REPAINT: {\n transform: true,\n translateX: true,\n translateY: true,\n skewX: true,\n skewY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n color: true,\n fontStyle: true,\n strokeWidth: true,\n fill: true,\n strokeDasharray: true,\n strokeLinecap: true,\n strokeLinejoin: true,\n strokeMiterlimit: true,\n backgroundColor: true,\n backgroundImage: true,\n backgroundPositionX: true,\n backgroundPositionY: true,\n backgroundRepeat: true,\n backgroundSize: true,\n stroke: true,\n borderBottomColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomRightRadius: true,\n borderBottomLeftRadius: true,\n visibility: true,\n opacity: true,\n zIndex: true,\n filter: true,\n boxShadow: true,\n },\n MEASURE: {\n fontSize: true,\n fontWeight: true,\n fontFamily: true,\n },\n isIgnore(k) {\n return this.IGNORE.hasOwnProperty(k);\n },\n isRepaint(k) {\n return this.REPAINT.hasOwnProperty(k) || this.isGeom(k);\n },\n isMeasure(k) {\n return this.MEASURE.hasOwnProperty(k);\n },\n addGeom(tagName, ks) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k);\n });\n }\n else if(ks) {\n let list = o.GEOM[ks] = o.GEOM[ks] || {};\n list[tagName] = true;\n }\n },\n isGeom(tagName, k) {\n return this.GEOM.hasOwnProperty(k) && this.GEOM[k].hasOwnProperty(tagName);\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(reset.DOM.hasOwnProperty(k)) {\n return true;\n }\n // geom的fill等矢量才有的样式\n if(tagName.charAt(0) === '$' && reset.GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(this.GEOM.hasOwnProperty(k)) {\n return this.GEOM[k].hasOwnProperty(tagName);\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(o.MEASURE);\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n return true;\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls', 'start', 'end']);\no.addGeom('$polygon', ['points', 'controls', 'start', 'end']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport util from '../util/util';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING } = unit;\nconst { isNil, rgba2int } = util;\n\nconst DEFAULT_FONT_SIZE = 16;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\n/**\n * 通用的格式化计算数值单位的方法,百分比像素auto和纯数字,直接修改传入对象本身\n * @param obj 待计算的样式对象\n * @param k 对象的key\n * @param v 对象的value\n * @returns 格式化好的样式对象本身\n */\nfunction calUnit(obj, k, v) {\n if(v === 'auto') {\n obj[k] = {\n unit: AUTO,\n };\n }\n else if(v === 'inherit') {\n obj[k] = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PERCENT,\n };\n }\n else if(/px$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PX,\n };\n }\n else if(/deg$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: DEG,\n };\n }\n else {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: NUMBER,\n };\n }\n // border相关不能为负值\n if(k.toString().indexOf('border') === 0) {\n obj[k].value = Math.max(obj[k].value, 0);\n }\n return obj;\n}\n\nfunction compatibleTransform(k, v) {\n if(k.indexOf('scale') > -1) {\n v.unit = NUMBER;\n }\n else if(k.indexOf('translate') > -1) {\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n }\n else {\n if(v.unit === NUMBER) {\n v.unit = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式\n * @returns Object 标准化的样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n delete style.border;\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n delete style[k];\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n delete style.borderWidth;\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n delete style.borderColor;\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n delete style.borderStyle;\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n delete style.borderRadius;\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n delete style.background;\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n delete style.backgroundPosition;\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n delete style.flex;\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n delete style.margin;\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n delete style.padding;\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n console.error(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n temp = style.rotate;\n if(!isNil(temp)) {\n abbr.toFull(style, 'rotate');\n delete style.rotate;\n }\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp) {\n // 区分是渐变色还是图\n if(reg.gradient.test(temp)) {\n style.backgroundImage = gradient.parseGradient(temp);\n }\n else if(reg.img.test(temp)) {\n style.backgroundImage = reg.img.exec(temp)[2];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,6}/i.exec(temp);\n if(bgc && [4, 7].indexOf(bgc[0].length) > -1) {\n style.backgroundColor = {\n value: rgba2int(bgc[0]),\n unit: RGBA,\n };\n }\n else {\n bgc = /rgba?\\(.+\\)/i.exec(temp);\n style.backgroundColor = {\n value: rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]),\n unit: RGBA,\n };\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n if(/%$/.test(temp) || /px$/i.test(temp) || /^-?[\\d.]+$/.test(temp)) {\n calUnit(style, k, temp);\n temp = style[k];\n if(temp.unit === NUMBER) {\n temp.unit = PX;\n }\n }\n else {\n style[k] = {\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[temp],\n unit: PERCENT,\n };\n }\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n let bc = style.backgroundSize = [];\n let match = temp.toString().match(/\\b(?:(-?[\\d.]+(px|%)?)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(bc, i, item);\n if(bc[i].unit === NUMBER) {\n bc[i].unit = PX;\n }\n }\n else if(item === '0' || item === 0) {\n bc.push({\n value: 0,\n unit: PX,\n });\n }\n else if(item === 'contain' || item === 'cover') {\n bc.push({\n value: item,\n unit: STRING,\n });\n }\n else {\n bc.push({\n unit: AUTO,\n });\n }\n }\n }\n else {\n bc.push({\n unit: AUTO,\n });\n bc[1] = bc[0];\n }\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n style[k] = {\n value: rgba2int(v),\n unit: RGBA,\n };\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(arr, i, item);\n if(arr[i].unit === NUMBER) {\n arr[i].unit = PX;\n }\n }\n else {\n arr[i] = {\n value: 0,\n unit: PX,\n };\n }\n }\n style[k] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = style.transform = [];\n let match = temp.toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push(['matrix', arr]);\n }\n }\n else if({\n 'translateX': true,\n 'translateY': true,\n 'scaleX': true,\n 'scaleY': true,\n 'skewX': true,\n 'skewY': true,\n 'rotate': true,\n 'rotateZ': true,\n }.hasOwnProperty(k)) {\n if(k === 'rotate') {\n k = 'rotateZ';\n }\n let arr = calUnit([k, v], 1, v);\n compatibleTransform(k, arr[1]);\n transform.push(arr);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n let arr1 = calUnit([k + 'X', arr[0]], 1, arr[0]);\n let arr2 = calUnit([k + 'Y', arr[1]], 1, arr[1]);\n compatibleTransform(k, arr1[1]);\n compatibleTransform(k, arr2[1]);\n transform.push(arr1);\n transform.push(arr2);\n }\n });\n }\n }\n temp = style.transformOrigin;\n if(!isNil(temp)) {\n let tfo = style.transformOrigin = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(tfo, i, item);\n if(tfo[i].unit === NUMBER) {\n tfo[i].unit = PX;\n }\n }\n else {\n tfo.push({\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n unit: PERCENT,\n });\n // 不规范的写法变默认值50%\n if(isNil(tfo[i].value)) {\n tfo[i].value = 50;\n }\n }\n }\n }\n else {\n tfo.push({\n value: 50,\n unit: PERCENT,\n });\n tfo[1] = tfo[0];\n }\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n if(k === 'rotate') {\n k = 'rotateZ';\n style.rotateZ = style.rotate;\n delete style.rotate;\n }\n // 没有单位或默认值处理单位\n v = style[k];\n compatibleTransform(k, v);\n });\n temp = style.opacity;\n if(temp) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n style.opacity = temp;\n }\n else {\n style.opacity = 1;\n }\n }\n temp = style.zIndex;\n if(temp) {\n style.zIndex = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n 'flexBasis',\n 'strokeWidth',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n v = style[k];\n // 无单位视为px\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n });\n temp = style.color;\n if(temp) {\n if(temp === 'inherit') {\n style.color = {\n unit: INHERIT,\n };\n }\n else {\n style.color = {\n value: rgba2int(temp),\n unit: RGBA,\n };\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.fontSize = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(temp)) {\n let v = Math.max(0, parseFloat(temp));\n if(v) {\n style.fontSize = {\n value: v,\n unit: PERCENT,\n };\n }\n else {\n style.fontSize = {\n value: DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n else {\n style.fontSize = {\n value: Math.max(0, parseFloat(temp)) || DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n temp = style.fontWeight;\n if(temp || temp === 0) {\n if(temp === 'bold') {\n style.fontWeight = {\n value: 700,\n unit: NUMBER,\n };\n }\n else if(temp === 'normal') {\n style.fontWeight = {\n value: 400,\n unit: NUMBER,\n };\n }\n else if(temp === 'lighter') {\n style.fontWeight = {\n value: 200,\n unit: NUMBER,\n };\n }\n else if(temp === 'inherit') {\n style.fontWeight = {\n unit: INHERIT,\n };\n }\n else {\n style.fontWeight = {\n value: Math.max(0, parseInt(temp)) || 400,\n unit: NUMBER,\n };\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n style.fontStyle = {\n unit: INHERIT,\n };\n }\n else {\n style.fontStyle = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n style.fontFamily = {\n unit: INHERIT,\n };\n }\n else {\n style.fontFamily = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n style.textAlign = {\n unit: INHERIT,\n };\n }\n else {\n style.textAlign = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.lineHeight;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.lineHeight = {\n unit: INHERIT,\n };\n }\n else if(temp === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/px$/i.test(temp)) {\n style.lineHeight = {\n value: parseFloat(temp),\n unit: PX,\n };\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n else {\n style.lineHeight = {\n value: n,\n unit: NUMBER,\n };\n }\n }\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n style.strokeDasharray = match;\n }\n else {\n style.strokeDasharray = [];\n }\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.fill = gradient.parseGradient(temp);\n }\n else {\n style.fill = rgba2int(temp);\n }\n }\n temp = style.stroke;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.stroke = gradient.parseGradient(temp);\n }\n else {\n style.stroke = rgba2int(temp);\n }\n }\n temp = style.filter;\n if(temp) {\n style.filter = [];\n let blur = /\\bblur\\s*\\(\\s*([\\d.]+)\\s*(?:px)?\\s*\\)/i.exec(temp);\n if(blur) {\n let v = parseFloat(blur[1]) || 0;\n if(v) {\n style.filter.push(['blur', v]);\n }\n }\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n style.visibility = {\n unit: INHERIT,\n };\n }\n else {\n style.visibility = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n style.pointerEvents = {\n unit: INHERIT,\n };\n }\n else {\n style.pointerEvents = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.boxShadow;\n if(temp) {\n style.boxShadow = [];\n let match = temp.match(/(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?\\s*)?(-?[\\d.]+(px)?\\s*)?(((transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n match.forEach(item => {\n let boxShadow = /(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?\\s*)?(-?[\\d.]+(?:px)?\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,6})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n let res = [boxShadow[1], boxShadow[2], boxShadow[3] || 0, boxShadow[4] || 0, boxShadow[5] || '#000', boxShadow[6] || 'outset'];\n for(let i = 0; i < 4; i++) {\n calUnit(res, i, res[i]);\n // x/y可以负,blur和spread不行,没有继承且只有px无需保存单位\n if(i > 1 && res[i].value < 0) {\n res[i] = 0;\n }\n if(res[i].unit === NUMBER) {\n res[i] = res[i].value;\n }\n }\n res[4] = rgba2int(res[4]);\n style.boxShadow.push(res);\n }\n });\n }\n return style;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let parentComputedStyle = !isHost && parent.computedStyle;\n change.MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n if(v.unit === INHERIT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v.unit === PERCENT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : (parentComputedStyle[k] * v.value * 0.01);\n }\n else {\n computedStyle[k] = v.value;\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let { textAlign, lineHeight } = currentStyle;\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ].forEach(k => {\n // border-width不支持百分比\n computedStyle[k] = (currentStyle[k].unit === PX) ? Math.max(0, currentStyle[k].value) : 0;\n });\n [\n 'position',\n 'display',\n 'flexDirection',\n 'justifyContent',\n 'alignItems',\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(textAlign.unit === INHERIT) {\n computedStyle.textAlign = isRoot ? 'left' : parentComputedStyle.textAlign;\n }\n else {\n computedStyle.textAlign = isRoot ? 'left' : textAlign.value;\n }\n if(lineHeight.unit === INHERIT) {\n computedStyle.lineHeight = isRoot ? calNormalLineHeight(computedStyle) : parentComputedStyle.lineHeight;\n }\n // 防止为0\n else if(lineHeight.unit === PX) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight.unit === NUMBER) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) * computedStyle.fontSize || calNormalLineHeight(computedStyle);\n }\n // normal\n else {\n computedStyle.lineHeight = calNormalLineHeight(computedStyle);\n }\n}\n\nfunction setFontStyle(style) {\n let { fontStyle, fontWeight, fontSize, fontFamily } = style;\n return (fontStyle || 'normal') + ' ' + (fontWeight || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (fontFamily || 'arial');\n}\n\nfunction getBaseLine(style) {\n let normal = style.fontSize * font.arial.lhr;\n return (style.lineHeight - normal) * 0.5 + style.fontSize * font.arial.blr;\n}\n\nfunction calNormalLineHeight(computedStyle) {\n return computedStyle.fontSize * font.arial.lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style.unit === AUTO) {\n if(k === 'width') {\n parent = parent.parent;\n }\n else {\n break;\n }\n }\n else if(style.unit === PX) {\n return n * style.value;\n }\n else if(style.unit === PERCENT) {\n n *= style.value * 0.01;\n parent = parent.parent;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v.value, parent, 'width');\n }\n else {\n v = calRelativePercent(v.value, parent, 'height');\n }\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n v = v.value * size * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === 'transform') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n if(oa === 'matrix') {\n if(!util.equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n else if(!util.equal(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === 'filter') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!util.equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === 'transformOrigin' || k === 'backgroundSize') {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a.value === b.value && a.unit === b.unit;\n }\n if(k === 'boxShadow') {\n return util.equalArr(a, b);\n }\n if(RADIUS_HASH.hasOwnProperty(k)) {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a.unit === b.unit && util.equalArr(a.value, b.value);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1].value !== bi[1].value || ai[1].unit !== bi[1].unit) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(change.isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return util.equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle.position;\n return position === 'relative' || position === 'absolute';\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass LineBox {\n constructor(parent, x, y, w, content) {\n this.__parent = parent;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__content = content;\n this.__virtualDom = {};\n }\n\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox + dx;\n y += oy + dy;\n if(renderMode === mode.CANVAS) {\n ctx.fillText(content, x, y);\n }\n else if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props: [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle.color],\n ['font-family', computedStyle.fontFamily],\n ['font-weight', computedStyle.fontWeight],\n ['font-style', computedStyle.fontStyle],\n ['font-size', computedStyle.fontSize + 'px']\n ],\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return css.getBaseLine(this.parent.computedStyle);\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n}\n\nexport default LineBox;\n","import Node from './Node';\nimport LineBox from './LineBox';\nimport mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__lineBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n static CHAR_WIDTH_CACHE = {};\n static MEASURE_TEXT = {\n list: [],\n data: {},\n };\n\n // 预先计算每个字的宽度\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n if(renderMode === mode.CANVAS) {\n ctx.font = css.setFontStyle(computedStyle);\n }\n let key = computedStyle.fontSize + ',' + computedStyle.fontFamily + ',' + computedStyle.fontWeight;\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 + ',' + computedStyle.fontWeight;\n let cache = Text.CHAR_WIDTH_CACHE[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n __layout(data, isVirtual) {\n let { x, y, w } = data;\n this.__x = x;\n this.__y = y;\n let { isDestroyed, content, computedStyle, lineBoxes, charWidthList } = this;\n if(isDestroyed || computedStyle.display === 'none') {\n return;\n }\n this.__ox = this.__oy = 0;\n lineBoxes.splice(0);\n // 顺序尝试分割字符串为lineBox,形成多行\n let begin = 0;\n let i = 0;\n let count = 0;\n let length = content.length;\n let maxW = 0;\n while(i < length) {\n count += charWidthList[i];\n if(count === w) {\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, i + 1));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n begin = i + 1;\n i = begin;\n count = 0;\n }\n else if(count > w) {\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行\n if(i === begin) {\n i = begin + 1;\n width = count;\n }\n else {\n width = count - charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, width, content.slice(begin, i));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, width);\n y += computedStyle.lineHeight;\n begin = i;\n count = 0;\n }\n else {\n i++;\n }\n }\n // 最后一行,只有一行未满时也进这里\n if(begin < length && begin < i) {\n count = 0;\n for(i = begin; i < length; i++) {\n count += charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, length));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n }\n this.__width = maxW;\n this.__height = y - data.y;\n // flex/abs前置计算无需真正布局\n if(!isVirtual) {\n let { textAlign } = computedStyle;\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxes.forEach(lineBox => {\n let diff = this.__width - lineBox.width;\n if(diff > 0) {\n lineBox.__offsetX(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n }\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n }\n\n __tryLayInline(w) {\n return w - this.textWidth;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\n }\n\n render(renderMode, lv, ctx, defs, dx = 0, dy = 0) {\n if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n let { isDestroyed, computedStyle, lineBoxes, cacheStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') {\n return;\n }\n if(renderMode === mode.CANVAS) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle.color;\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n }\n lineBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle, dx, dy);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = lineBoxes.map(lineBox => lineBox.virtualDom);\n }\n }\n\n deepScan(cb) {\n cb(this);\n }\n\n __mergeBbox(matrix, tx, ty, dx, dy) {\n return util.transformBbox(this.bbox, matrix, dx, dy);\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get lineBoxes() {\n return this.__lineBoxes;\n }\n\n get charWidthList() {\n return this.__charWidthList;\n }\n\n get charWidth() {\n return this.__charWidth;\n }\n\n get textWidth() {\n return this.__textWidth;\n }\n\n get baseLine() {\n let { lineBoxes } = this;\n if(!lineBoxes.length) {\n return 0;\n }\n let last = lineBoxes[lineBoxes.length - 1];\n return last.y - this.y + last.baseLine;\n }\n\n get currentStyle() {\n return this.parent.currentStyle;\n }\n\n get computedStyle() {\n return this.parent.computedStyle;\n }\n\n get cacheStyle() {\n return this.parent.__cacheStyle;\n }\n\n get bbox() {\n let { sx, sy, width, height } = this;\n let x1 = sx, y1 = sy;\n let x2 = sx + width, y2 = sy + height;\n return [x1, y1, x2, y2];\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","function canvasPolygon(ctx, list, dx = 0, dy = 0) {\n if(!list || !list.length) {\n return;\n }\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n ctx.moveTo(list[start][0] + dx, list[start][1] + dy);\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0] + dx, item[1] + dy);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy, item[4] + dx, item[5] + dy);\n }\n }\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let s = 'M' + list[start][0] + ',' + list[start][1];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num, dx = 0, dy = 0) {\n ctx.moveTo(x1 + dx, y1 + dy);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0] + dx, controlA[1] + dy, controlB[0] + dx, controlB[1], x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0] + dx, controlB[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0] + dx, controlA[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else {\n ctx.lineTo(x2 + dx, y2 + dy);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nconst OFFSET = Math.PI * 0.5;\n\nfunction canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure, dx = 0, dy = 0) {\n ctx.arc(cx + dx, cy + dy, r, begin * Math.PI / 180 - OFFSET, end * Math.PI / 180 - OFFSET);\n if(edge) {\n if(!large || !closure) {\n ctx.lineTo(cx + dx, cy + dy);\n }\n ctx.lineTo(x1 + dx, y1 + dy);\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 + dx, cy + dy);\n }\n ctx.lineTo(x1 + dx, y1 + dy);\n }\n}\n\nfunction svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure) {\n let d = closure && large\n ? ('M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z')\n : ('M' + cx + ',' + cy + 'L' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z');\n let d2;\n if(!edge || strokeWidth > 0) {\n d2 = 'M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2;\n }\n return [d, d2];\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasSector,\n svgSector,\n};\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[4] = -sx1;\n m[5] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[4] = -tx1;\n n[5] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[3] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[2] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[3] = -m[3];\n m[5] = -m[5];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[4] = tx1;\n t[5] = ty1;\n m = matrix.multiply(t, m);\n return m;\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\n};\n","import unit from '../style/unit';\nimport math from '../math/index';\nimport util from '../util/util';\n\nconst { PX, PERCENT } = unit;\nconst { matrix, geom } = math;\nconst { identity, calPoint, multiply } = matrix;\nconst { d2r, pointInPolygon } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === 'translateX') {\n t[4] = v;\n }\n else if(k === 'translateY') {\n t[5] = v;\n }\n else if(k === 'scaleX') {\n t[0] = v;\n }\n else if(k === 'scaleY') {\n t[3] = v;\n }\n else if(k === 'skewX') {\n v = d2r(v);\n t[2] = Math.tan(v);\n }\n else if(k === 'skewY') {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === 'rotateZ') {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n }\n else if(k === 'matrix') {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n }\n}\n\nfunction calMatrix(transform, ow, oh) {\n let list = normalize(transform, ow, oh);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n if(ox === 0 && oy === 0) {\n return m;\n }\n let t = identity();\n t[4] = ox;\n t[5] = oy;\n let res = multiply(t, m);\n let t2 = identity();\n t2[4] = -ox;\n t2[5] = -oy;\n res = multiply(res, t2);\n return res;\n}\n\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\n// 判断点是否在一个矩形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n [x1, y1] = calPoint([x1, y1], matrix);\n [x2, y2] = calPoint([x2, y2], matrix);\n [x3, y3] = calPoint([x3, y3], matrix);\n [x4, y4] = calPoint([x4, y4], matrix);\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\nfunction normalizeSingle(k, v, ow, oh) {\n if(k === 'translateX') {\n if(v.unit === PERCENT) {\n return v.value * ow * 0.01;\n }\n }\n else if(k === 'translateY') {\n if(v.unit === PERCENT) {\n return v.value * oh * 0.01;\n }\n }\n else if(k === 'matrix') {\n return v;\n }\n return v.value;\n}\n\nfunction normalize(transform, ow, oh) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item.unit === PX) {\n tfo.push(item.value);\n }\n else if(item.unit === PERCENT) {\n tfo.push(item.value * (i ? h : w) * 0.01);\n }\n });\n return tfo;\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n pointInQuadrilateral,\n};\n","/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nimport geom from '../math/geom';\n\nconst { H } = geom;\n\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btw boderTopWidth\n * @param brw borderRightWidth\n * @param bbw borderBottomWidth\n * @param blw borderLeftWidth\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n // 先减去对应borderWidth,因为border可能比较宽,弧度只体现在外圆弧,有可能radius为0减去后为负数需判断\n btlx -= blw;\n btly -= btw;\n btrx -= brw;\n btry -= btw;\n bbrx -= brw;\n bbry -= bbw;\n bblx -= blw;\n bbly -= bbw;\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n};\n","import unit from './unit';\nimport transform from './transform';\n\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n ['scaleX', {\n value: targetWidth / imgWidth,\n unit: NUMBER,\n }],\n ['scaleY', {\n value: targetHeight / imgHeight,\n unit: NUMBER,\n }]\n ];\n let tfo = transform.calOrigin([\n {\n value: 0,\n unit: PERCENT,\n },\n {\n value: 0,\n unit: PERCENT,\n }\n ], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","const VERTEX = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying vec2 vTextureCoord;\nuniform mat3 projectionMatrix;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}`;\n\nconst FRAGMENT = `\n#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}`;\n\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if (!program) {\n console.error('Failed to create program');\n return false;\n }\n\n gl.useProgram(program);\n gl.program = program;\n\n return true;\n}\n\nfunction createProgram(gl, vshader, fshader) {\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if (!vertexShader || !fragmentShader) {\n return null;\n }\n\n let program = gl.createProgram();\n if (!program) {\n return null;\n }\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if (!linked) {\n let error = gl.getProgramInfoLog(program);\n console.error('Failed to link program: ' + error);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n return null;\n }\n return program;\n}\n\nfunction loadShader(gl, type, source) {\n let shader = gl.createShader(type);\n if (shader == null) {\n console.error('unable to create shader');\n return null;\n }\n\n gl.shaderSource(shader, source);\n\n gl.compileShader(shader);\n\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!compiled) {\n let error = gl.getShaderInfoLog(shader);\n console.error('Failed to compile shader: ' + error);\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}\n\nfunction initVertexBuffers(gl) {\n let vertices = new Float32Array([\n -1, 1, 0.0, 1.0,\n -1, -1, 0.0, 0.0,\n 1, 1, 1.0, 1.0,\n 1, -1, 1.0, 0.0\n ]);\n let vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n let FSIZE = Float32Array.BYTES_PER_ELEMENT;\n let aPosition = gl.getAttribLocation(gl.program, 'aVertexPosition');\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, FSIZE * 4, 0);\n gl.enableVertexAttribArray(aPosition);\n let aTexCoord = gl.getAttribLocation(gl.program, 'aTextureCoord');\n gl.vertexAttribPointer(aTexCoord, 2, gl.FLOAT, false, FSIZE * 4, FSIZE * 2);\n\n let projectionMatrix = gl.getUniformLocation(gl.program, 'projectionMatrix');\n gl.uniformMatrix3fv(projectionMatrix, false, new Float32Array(\n [ 1, 0, 0,\n 0, 1, 0,\n 0, 0, 1 ]));\n gl.enableVertexAttribArray(aTexCoord);\n return {\n aPosition,\n aTexCoord,\n };\n}\n\nfunction initLocation(gl) {\n let uSampler = gl.getUniformLocation(gl.program, 'uSampler');\n let uOffset = gl.getUniformLocation(gl.program, 'uOffset');\n let uClamp = gl.getUniformLocation(gl.program, 'filterClamp');\n return {\n uSampler,\n uOffset,\n uClamp,\n };\n}\n\nfunction createAndSetupTexture(gl) {\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // 设置材质,这样我们可以对任意大小的图像进行像素操作\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n return texture;\n}\n\nclass KawaseBlurFilter {\n constructor(webgl, blur = 1, quality = 4) {\n this.webgl = webgl;\n let gl = this.gl = webgl.ctx;\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n initShaders(gl, VERTEX, FRAGMENT);\n this.vertexLocations = initVertexBuffers(gl);\n this.textureLocations = initLocation(gl);\n this._pixelSize = { x: 0, y: 0 };\n this.pixelSize = 1;\n this._kernels = null;\n this._blur = blur;\n this.quality = quality;\n // 创建两个纹理绑定到帧缓冲\n this.textures = [];\n this.framebuffers = [];\n }\n\n initBuffers(gl, width, height) {\n for (let i = 0; i < 2; i++) {\n let texture = createAndSetupTexture(gl);\n this.textures.push(texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n // 创建一个帧缓冲\n let fbo = gl.createFramebuffer();\n this.framebuffers.push(fbo);\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n // 绑定纹理到帧缓冲\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n }\n }\n\n draw(image, uOffsetArray, clear) {\n let { uOffset, uClamp } = this.textureLocations;\n let { gl } = this;\n gl.uniform2f(uOffset, uOffsetArray[0], uOffsetArray[1]);\n gl.viewport(0, 0, image.width, image.height);\n gl.uniform4f(uClamp, 0, 0, image.width, image.height);\n if (clear) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n apply(target, width, height) {\n let { gl } = this;\n this.initBuffers(gl, width, height);\n let { uSampler } = this.textureLocations;\n gl.uniform1i(uSampler, 0);\n let originalImageTexture = createAndSetupTexture(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, target.canvas);\n\n let uvX = this._pixelSize.x / width;\n let uvY = this._pixelSize.y / height;\n let offset;\n let last = this._quality - 1;\n // 从原始图像开始\n gl.bindTexture(gl.TEXTURE_2D, originalImageTexture);\n for (let i = 0; i < last; i++) {\n offset = this._kernels[i] + 0.5;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffers[i % 2]);\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, false);\n gl.bindTexture(gl.TEXTURE_2D, this.textures[i % 2]);\n }\n offset = this._kernels[last] + 0.5;\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, true);\n this.webgl.draw();\n target.ctx.clearRect(0, 0, width, height);\n target.ctx.drawImage(gl.canvas, 0, 0);\n target.draw();\n return this;\n }\n\n /**\n * Auto generate kernels by blur & quality\n * @private\n */\n _generateKernels() {\n let blur = this._blur;\n let quality = this._quality;\n let kernels = [ blur ];\n\n if (blur > 0) {\n let k = blur;\n let step = blur / quality;\n\n for (let i = 1; i < quality; i++) {\n k -= step;\n kernels.push(k);\n }\n }\n\n this._kernels = kernels;\n }\n\n /**\n * The kernel size of the blur filter, for advanced usage.\n *\n * @member {number[]}\n * @default [0]\n */\n get kernels() {\n return this._kernels;\n }\n\n set kernels(value) {\n if (Array.isArray(value) && value.length > 0) {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max.apply(Math, value);\n } else {\n // if value is invalid , set default value\n this._kernels = [ 0 ];\n this._quality = 1;\n }\n }\n\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n *\n * @member {PIXI.Point|number[]}\n * @default [1, 1]\n */\n set pixelSize(value) {\n if (typeof value === 'number') {\n this._pixelSize.x = value;\n this._pixelSize.y = value;\n } else if (Array.isArray(value)) {\n this._pixelSize.x = value[0];\n this._pixelSize.y = value[1];\n } else {\n // if value is invalid , set default value\n this._pixelSize.x = 1;\n this._pixelSize.y = 1;\n }\n }\n\n get pixelSize() {\n return this._pixelSize;\n }\n\n /**\n * The quality of the filter, integer greater than `1`.\n *\n * @member {number}\n * @default 3\n */\n get quality() {\n return this._quality;\n }\n\n set quality(value) {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n }\n\n /**\n * The amount of blur, value greater than `0`.\n *\n * @member {number}\n * @default 4\n */\n get blur() {\n return this._blur;\n }\n\n set blur(value) {\n this._blur = value;\n this._generateKernels();\n }\n\n clear() {\n let gl = this.gl;\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n}\n\nfunction gaussBlur(target, webgl, blur, width, height) {\n return new KawaseBlurFilter(webgl, blur).apply(target, width, height);\n}\n\nexport default {\n gaussBlur,\n};\n","import Text from '../node/Text';\rimport util from './util';\r\rconst SPF = 1000 / 60;\r\rconst CANVAS = {};\rconst WEBGL = {};\r\rfunction cache(key, width, height, hash) {\r let o;\r if(!key) {\r o = document.createElement('canvas');\r }\r else if(!hash[key]) {\r o = hash[key] = document.createElement('canvas');\r }\r else {\r o = hash[key];\r }\r o.setAttribute('width', width + 'px');\r o.setAttribute('height', height + 'px');\r if(typeof karas !== 'undefined' && karas.debug) {\r o.style.width = width + 'px';\r o.style.height = height + 'px';\r o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\r if(key) {\r o.setAttribute('key', key);\r }\r document.body.appendChild(o);\r }\r return {\r canvas: o,\r ctx: hash === CANVAS ? o.getContext('2d')\r : (o.getContext('webgl') || o.getContext('experimental-webgl')),\r draw() {\r // 空函数,仅对小程序提供hook特殊处理,flush缓冲\r },\r available: true,\r release() {\r this.canvas = null;\r this.ctx = null;\r },\r };\r}\r\rfunction cacheCanvas(key, width, height) {\r return cache(key, width, height, CANVAS);\r}\r\rfunction cacheWebgl(key, width, height) {\r return cache(key, width, height, WEBGL);\r}\r\rconst IMG = {};\rconst INIT = 0;\rconst LOADING = 1;\rconst LOADED = 2;\r\rlet inject = {\r measureText(cb) {\r let { list, data } = Text.MEASURE_TEXT;\r let html = '';\r let keys = [];\r let chars = [];\r Object.keys(data).forEach(i => {\r let { key, style, s } = data[i];\r if(s) {\r let inline = `position:absolute;font-family:${style.fontFamily};font-size:${style.fontSize}px;font-weight:${style.fontWeight}`;\r for(let j = 0, len = s.length; j < len; j++) {\r keys.push(key);\r let char = s.charAt(j);\r chars.push(char);\r html += `${char.replace(/`;\r }\r }\r });\r if(!html) {\r cb();\r return;\r }\r let div = document.createElement('div');\r div.style.position = 'absolute';\r div.style.left = '99999px';\r div.style.top = '-99999px';\r div.style.visibility = 'hidden';\r document.body.appendChild(div);\r div.innerHTML = html;\r let cns = div.childNodes;\r let { CHAR_WIDTH_CACHE, MEASURE_TEXT } = Text;\r for(let i = 0, len = cns.length; i < len; i++) {\r let node = cns[i];\r let key = keys[i];\r let char = chars[i];\r // clientWidth只返回ceil整数,精度必须用getComputedStyle\r let css = window.getComputedStyle(node, null);\r CHAR_WIDTH_CACHE[key][char] = parseFloat(css.width);\r }\r list.forEach(text => text.__measureCb());\r cb();\r MEASURE_TEXT.list = [];\r MEASURE_TEXT.data = {};\r document.body.removeChild(div);\r },\r IMG,\r INIT,\r LOADED,\r LOADING,\r measureImg(url, cb) {\r let cache = IMG[url] = IMG[url] || {\r state: INIT,\r task: [],\r };\r if(cache.state === LOADED) {\r cb(cache);\r }\r else if(cache.state === LOADING) {\r cache.task.push(cb);\r }\r else {\r cache.state = LOADING;\r cache.task.push(cb);\r let img = new Image();\r img.onload = function() {\r cache.state = LOADED;\r cache.success = true;\r cache.width = img.width;\r cache.height = img.height;\r cache.source = img;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r img.onerror = function() {\r cache.state = LOADED;\r cache.success = false;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r if(url.substr(0, 5) !== 'data:') {\r let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\r if(host) {\r if(location.hostname !== host[1]) {\r img.crossOrigin = 'anonymous';\r }\r }\r }\r img.src = url;\r }\r },\r warn(s) {\r console.warn(s);\r },\r requestAnimationFrame(cb) {\r let res;\r if(typeof requestAnimationFrame !== 'undefined') {\r inject.requestAnimationFrame = requestAnimationFrame.bind(window);\r res = requestAnimationFrame(cb);\r }\r else {\r res = setTimeout(cb, SPF);\r inject.requestAnimationFrame = function(cb) {\r return setTimeout(cb, SPF);\r };\r }\r return res;\r },\r cancelAnimationFrame(id) {\r let res;\r if(typeof cancelAnimationFrame !== 'undefined') {\r inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\r res = cancelAnimationFrame(id);\r }\r else {\r res = clearTimeout(id);\r inject.cancelAnimationFrame = function(id) {\r return clearTimeout(id);\r };\r }\r return res;\r },\r now() {\r if(typeof performance !== 'undefined') {\r inject.now = function() {\r return Math.floor(performance.now());\r };\r return Math.floor(performance.now());\r }\r inject.now = Date.now.bind(Date);\r return Date.now();\r },\r hasCacheCanvas(key) {\r return key && CANVAS.hasOwnProperty(key);\r },\r getCacheCanvas(width, height, key) {\r return cacheCanvas(key, width, height);\r },\r delCacheCanvas(key) {\r key && delete CANVAS[key];\r },\r hasCacheWebgl(key) {\r return key && WEBGL.hasOwnProperty(key);\r },\r getCacheWebgl(width, height, key) {\r return cacheWebgl(key, width, height);\r },\r delCacheWebgl(key) {\r key && delete WEBGL[key];\r },\r isDom(o) {\r if(o) {\r if(util.isString(o)) {\r return true;\r }\r if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\r return true;\r }\r if(util.isFunction(o.getElementsByTagName)) {\r return true;\r }\r }\r return false;\r },\r};\r\rexport default inject;\r","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n on(id, handle) {\n if(!handle) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else if(handle) {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction } = util;\n\nfunction traversal(list, diff, step) {\n if(step === 'before') {\n list.forEach(item => {\n if(item && isFunction(item.before)) {\n item.before(diff);\n }\n });\n }\n else if(step === 'after') {\n list.forEach(item => {\n if(item && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__taskBF = [];\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task, taskBF } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || !task.length && !taskBF.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 cloneBF = taskBF.slice(0);\n let clone = task.slice(0);\n cloneBF.forEach(item => {\n item.before(diff);\n });\n traversal(clone, diff, 'before');\n // 执行动画造成的刷新并清空,在root的refreshTask回调中可能被清空,因为task已经刷新过了\n self.__hookTask.splice(0).forEach(item => item());\n // 普通的after\n cloneBF.forEach(item => {\n item.after(diff);\n });\n traversal(clone, diff, 'after');\n // 还有则继续,没有则停止节省性能\n if(task.length || taskBF.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task, taskBF } = this;\n if(!task.length && !taskBF.length) {\n this.__init();\n }\n task.push(handle);\n }\n\n __onFrameBF(animate) {\n let { task, taskBF } = this;\n if(!task.length && !taskBF.length) {\n this.__init();\n }\n taskBF.push(animate);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task, taskBF } = 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 && !taskBF.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n __offFrameBF(animate) {\n let { task, taskBF } = this;\n for(let i = 0, len = taskBF.length; i < len; i++) {\n let item = taskBF[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === animate) {\n animate.splice(i, 1);\n break;\n }\n }\n if(!task.length && !taskBF.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? diff => {\n handle(diff);\n this.offFrame(cb);\n } : {\n before: handle.before,\n after: diff => {\n handle.after && handle.after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n\n get taskBF() {\n return this.__taskBF;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n};\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\n\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER } = unit;\nconst { isNil, isFunction, isNumber, isObject, clone, equalArr } = util;\nconst { linear } = easing;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item.style;\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 空的过滤掉\n if(!isNil(v) && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(change.GEOM.hasOwnProperty(k)) {\n style[k] = target.currentProps[k];\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === 'transform') {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [['matrix', m]];\n }\n else if(v.unit === INHERIT) {\n if(k === 'color') {\n style[k] = {\n value: util.rgba2int(computedStyle[k]),\n unit: RGBA,\n };\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = {\n value: computedStyle[k],\n unit: PX,\n };\n }\n else if(k === 'fontWeight') {\n style[k] = {\n value: computedStyle[k],\n unit: NUMBER,\n };\n }\n else if(k === 'fontStyle' || k === 'fontFamily' || k === 'textAlign') {\n style[k] = {\n value: computedStyle[k],\n unit: STRING,\n };\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param animation\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, animation, root, node) {\n root.__addUpdate({\n node,\n style,\n });\n animation.__style = style;\n animation.__assigning = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n style = css.normalize(style);\n return {\n style,\n time: offset * duration,\n easing: easing || es,\n transition: [],\n };\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target) {\n let res = {\n k,\n };\n let p = prev[k];\n let n = next[k];\n if(k === 'transform') {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = [1, 0, 0, 1, 0, 0];\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = [1, 0, 0, 1, 0, 0];\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res.v = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n ];\n return res;\n }\n else if(k === 'filter') {\n // 目前只有1个blur,可以简单处理\n if(!p || !p.length) {\n res.v = n[0][1];\n }\n else if(!n || !n.length) {\n res.v = -p[0][1];\n }\n else {\n res.v = n[0][1] - p[0][1];\n }\n }\n else if(k === 'transformOrigin') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY') {\n if(p.unit === n.unit && [PX, PERCENT].indexOf(p.unit) > -1) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'boxShadow') {\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res.v.push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p.unit === n.unit) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'backgroundSize') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit && [PX, PERCENT].indexOf(pi.unit) > -1) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else {\n return;\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n if(p.k !== n.k) {\n return;\n }\n // 渐变\n else if(p.k === 'linear' || p.k === 'radial') {\n let pv = p.v;\n let nv = n.v;\n if(equalArr(pv, nv)) {\n return;\n }\n res.v = [];\n let { innerWidth } = target;\n let eq;\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n eq = equalArr(t, [0, 0, 0, 0]);\n if(a[1] && b[1]) {\n if(a[1].unit === b[1].unit) {\n t.push(b[1].value - a[1].value);\n }\n else if(a[1].unit === PX && b[1].unit === PERCENT) {\n t.push(b[1].value * innerWidth * 0.01 - a[1].value);\n }\n else if(a[1].unit === PERCENT && b[1].unit === PX) {\n t.push(b[1].value * 100 / innerWidth - a[1].value);\n }\n if(eq) {\n eq = t[4] === 0;\n }\n }\n else if(a[1] || b[1]) {\n eq = false;\n }\n res.v.push(t);\n }\n // 线性渐变有角度差值变化\n if(p.k === 'linear') {\n let v = n.d - p.d;\n if(eq && v === 0) {\n return;\n }\n res.d = v;\n }\n // 径向渐变的位置\n else {\n res.p = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp.unit === np.unit) {\n res.p.push(np.value - pp.value);\n }\n else if(pp.unit === PX && np.unit === PERCENT) {\n let v = np.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n else if(pp.unit === PERCENT && np.unit === PX) {\n let v = np.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n }\n if(eq && equalArr(res.p, [0, 0])) {\n return;\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, p)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n.value;\n p = p.value;\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0].value === p[0].value && n[0].unit === p[0].unit\n && n[1].value === p[1].value && n[1].unit === p[1].unit) {\n return;\n }\n res.v = [];\n for(let i = 0; i < 2; i++) {\n if(n[i].unit === p[i].unit) {\n res.v.push(n[i].value - p[i].value);\n }\n else if(p[i].unit === PX && n[i].unit === PERCENT) {\n res.v.push(n[i].value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else if(p[i].unit === PERCENT && n[i].unit === PX) {\n res.v.push(n[i].value * 100 / target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else {\n res.v.push(0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p.unit === AUTO || n.unit === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.parent || target).computedStyle;\n let diff = 0;\n if(p.unit === n.unit) {\n diff = n.value - p.value;\n }\n // 长度单位变化特殊计算,根据父元素computedStyle\n else if(p.unit === PX && n.unit === PERCENT) {\n let v;\n if(k === 'fontSize') {\n v = n.value * parentComputedStyle[k] * 0.01;\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.width * 0.01;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.height * 0.01;\n }\n diff = v - p.value;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v;\n if(k === 'fontSize') {\n v = n.value * 100 / parentComputedStyle[k];\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.width;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.height;\n }\n diff = v - p.value;\n }\n // lineHeight奇怪的单位变化\n else if(k === 'lineHeight') {\n if(p.unit === PX && n.unit === NUMBER) {\n diff = n.value * computedStyle.fontSize - p.value;\n }\n else if(p.unit === NUMBER && n.unit === PX) {\n diff = n.value / computedStyle.fontSize - p.value;\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res.v = diff;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n res.v.push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res.v = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\n return;\n }\n else {\n res.v = n - p;\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n if(n === p) {\n return;\n }\n res.v = n - p;\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target) {\n keys.forEach(k => {\n let ts = calDiff(prev.style, next.style, k, target);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev.transition.push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame.time > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame.time === time) {\n return middle;\n }\n else if(frame.time > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\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];\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, percent, target) {\n let style = clone(frame.style);\n let timingFunction = getEasing(frame.easing);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame.transition;\n for(let i = 0, len = transition.length; i < len; i++) {\n let { k, v, d, p } = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === 'transform') {\n if(!st) {\n st = style[k] = [['matrix', [1, 0, 0, 1, 0, 0]]];\n }\n for(let i = 0; i < 6; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n else if(k === 'filter') {\n // 只有1个样式声明了filter另外一个为空\n if(!st) {\n st = style[k] = [['blur', 0]];\n }\n st[0][1] += v * percent;\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i].value += v[i] * percent;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n if(v !== 0) {\n st.value += v * percent;\n }\n }\n else if(k === 'transformOrigin' || k === 'backgroundSize') {\n if(v[0] !== 0) {\n st[0].value += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1].value += v[1] * percent;\n }\n }\n else if(k === 'boxShadow') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n if(GRADIENT_TYPE.hasOwnProperty(st.k)) {\n for(let i = 0, len = Math.min(st.v.length, v.length); i < len; i++) {\n let a = st.v[i];\n let b = v[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1].value += b[1] * percent;\n }\n }\n if(st.k === 'linear' && st.d !== undefined && d !== undefined) {\n st.d += d * percent;\n }\n if(st.k === 'radial' && st.p !== undefined && p !== undefined) {\n st.p[0].value += p[0] * percent;\n st.p[1].value += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st.value;\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n let st = style[k];\n if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n style[k] += v * percent;\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\nlet lastCurrentTime;\nlet lastNextTime;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n this.__target = target;\n this.__root = target.root;\n list = clone(list || []);\n if(Array.isArray(list)) {\n this.__list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n this.__list = nl;\n }\n else {\n this.__list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {};\n this.__duration = Math.max(0, parseFloat(op.duration) || 0);\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.iterations = op.iterations;\n this.fps = op.fps;\n this.fill = op.fill;\n this.direction = op.direction;\n this.playbackRate = op.playbackRate;\n this.__easing = op.easing;\n this.__playCount = 0;\n this.spfLimit = op.spfLimit; // 定帧功能,不跳帧,每帧时间限制为最大spf\n this.__frames = []; // 每帧数据\n this.__framesR = []; // 存储反向播放的数据\n this.__startTime = null;\n this.currentTime = 0; // 当前播放时间点,不包括暂停时长,但包括delay、变速,以此定位动画处于何时\n this.__nextTime = 0; // 下一帧刷新时间点,即currentTime下一帧被此赋值\n this.__fpsTime = 0;\n this.__playState = 'idle';\n this.__isDestroyed = false;\n this.__style = {};\n this.__assigning = false; // 本帧动画是否正在影响赋值style,即在事件的before之后after之前\n this.__init();\n }\n\n __init() {\n let { iterations, duration, list, easing, target } = this;\n // 执行次数小于1无需播放\n if(iterations < 1 || list.length < 1) {\n return;\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n this.__frames = frames;\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = this.__keys = unify(frames, target);\n inherit(frames, keys, target);\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let o = this.__originStyle = {};\n keys.forEach(k => {\n if(change.isGeom(tagName, k)) {\n o[k] = props[k];\n }\n o[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target);\n }\n // 反向存储帧的倒排结果\n let framesR = clone(frames).reverse();\n framesR.forEach(item => {\n item.time = duration - item.time;\n item.transition = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target);\n }\n this.__framesR = framesR;\n }\n\n __clean(isFinish) {\n this.__cancelTask();\n this.__nextTime = 0;\n let restore;\n let { style, duration, iterations, keys, target } = this;\n if(isFinish) {\n this.__currentTime = this.delay + duration + this.endDelay;\n this.__playCount = iterations;\n this.__playState = 'finished';\n // cancel需要清除finish根据情况保留\n if(!this.__stayEnd()) {\n this.__style = {};\n restore = true;\n }\n }\n else {\n this.__playCount = this.__currentTime = 0;\n this.__playState = 'idle';\n this.__style = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n this.__currentFrames = undefined;\n this.__currentFrame = undefined;\n keys.forEach(k => {\n if(change.GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __fin(cb, diff) {\n // 防止重复触发\n if(!this.__hasFin) {\n this.__hasFin = true;\n this.__begin = this.__end = this.__isDelay = this.__finish = this.__inFps = this.__enterFrame = null;\n this.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n }\n\n __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.call(this, diff, isDelay);\n this.__playCb = null;\n }\n }\n\n __calDiffTime(diff) {\n let { playbackRate, spfLimit, fps } = this;\n let v = this.__currentTime = this.__nextTime;\n if(lastCurrentTime === v) {\n this.__nextTime = lastNextTime;\n return v;\n }\n lastCurrentTime = v;\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 lastNextTime = this.__nextTime += diff;\n return v;\n }\n\n play(cb) {\n let { isDestroyed, duration, playState, 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 // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n let firstEnter = true;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!this.__enterFrame) {\n let {\n frames,\n framesR,\n direction,\n delay,\n endDelay,\n root,\n } = this;\n // 特殊优化缓存\n let length = frames.length, is2 = length === 2;\n let lastI, lastFrame, endTime, endTimeR;\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 初始化根据方向确定帧序列\n let cfs = this.__currentFrames = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n if(is2) {\n endTime = cfs[1].time;\n endTimeR = 1 / endTime;\n }\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 // 每帧执行的回调,firstEnter只有初次计算时有,第一帧强制不跳帧\n let enterFrame = this.__enterFrame = {\n before: diff => {\n let { target, fps, playCount, iterations, currentFrames } = this;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let currentTime = this.__calDiffTime(diff);\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!firstEnter && fps < 60) {\n diff = this.__fpsTime += diff;\n if(diff < 1000 / fps) {\n this.__inFps = true;\n return;\n }\n this.__fpsTime = 0;\n }\n firstEnter = false;\n // delay仅第一次生效\n if(playCount > 0) {\n delay = 0;\n }\n // 还没过前置delay\n else if(currentTime < delay) {\n if(stayBegin) {\n let current = frames[0].style;\n genBeforeRefresh(current, this, root, target);\n }\n // 即便不刷新,依旧执行begin和帧回调\n if(currentTime === 0) {\n this.__begin = true;\n }\n this.__isDelay = true;\n return;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0) {\n this.__begin = true;\n }\n // 只有2帧可优化,否则2分查找当前帧\n let i;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n }\n // 索引不同再重设currentFrame\n let current;\n if(lastI !== i) {\n lastI = i;\n current = this.__currentFrame = lastFrame = currentFrames[i];\n }\n else {\n current = lastFrame;\n }\n // 最后一帧结束动画\n let isLastFrame = i === length - 1;\n let isLastCount = playCount >= iterations - 1;\n let inEndDelay;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n if(isLastFrame) {\n // endDelay实际最后一次播放时生效,这里仅计算时间对比\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n // 多次播放时到达最后一帧也会显示\n if(stayEnd || !isLastCount) {\n current = current.style;\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = this.__originStyle;\n }\n // 非尾每轮次放完增加次数和计算下轮准备\n if(!isLastCount) {\n this.__nextTime = currentTime - duration;\n playCount = ++this.__playCount;\n this.__nextBegin = true;\n }\n // 尾次考虑endDelay\n else if(!inEndDelay) {\n this.__nextTime = 0;\n playCount = ++this.__playCount;\n // 判断次数结束每帧enterFrame调用,inEndDelay时不结束\n if(playCount >= iterations) {\n frame.offFrame(enterFrame);\n }\n }\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n let percent = currentTime * endTimeR;\n current = calIntermediateStyle(current, percent, target);\n }\n else {\n let total = currentFrames[i + 1].time - current.time;\n let percent = (currentTime - current.time) / total;\n current = calIntermediateStyle(current, percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, this, root, target);\n // 每次循环完触发end事件,最后一次循环触发finish\n if(isLastFrame && (!inEndDelay || isLastCount)) {\n this.__end = true;\n if(playCount >= iterations) {\n this.__finish = true;\n this.__clean(true);\n }\n }\n },\n after: diff => {\n this.__assigning = false;\n if(this.__inFps) {\n this.__inFps = false;\n return;\n }\n this.__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(isAlternate) {\n let isEven = this.playCount % 2 === 0;\n if(direction === 'alternate') {\n this.__currentFrames = isEven ? frames : framesR;\n }\n else {\n this.__currentFrames = isEven ? framesR : frames;\n }\n }\n }\n if(this.__finish) {\n this.__finish = false;\n this.__fin();\n }\n if(this.__nextBegin) {\n this.__nextBegin = false;\n this.__begin = true;\n }\n },\n };\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this.__enterFrame);\n frame.onFrame(this.__enterFrame);\n this.__startTime = frame.__now;\n return this;\n }\n\n pause(silence) {\n let { isDestroyed, duration, pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n this.__playState = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let { isDestroyed, duration, playState } = this;\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || list.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let { root, frames, __originStyle } = self;\n if(root) {\n let current;\n if(self.__hasFin) {\n self.__fin(cb, 0);\n return self;\n }\n // 停留在最后一帧\n if(self.__stayEnd()) {\n current = frames[frames.length - 1].style;\n }\n else {\n current = __originStyle;\n }\n root.addRefreshTask({\n before() {\n genBeforeRefresh(current, self, root, self.target);\n self.__clean(true);\n },\n after(diff) {\n self.__assigning = false;\n self.__frameCb(diff);\n self.__fin(cb, diff);\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || playState === 'idle' || list.length < 1) {\n return self;\n }\n self.__cancelTask();\n let { root, __originStyle } = self;\n if(root) {\n if(self.__hasCancel) {\n if(isFunction(cb)) {\n cb.call(self, 0);\n }\n return self;\n }\n let task = (diff) => {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n self.__cancelTask();\n self.__begin = self.__end = self.__isDelay = self.__finish = self.__inFps = self.__enterFrame = null;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n };\n root.addRefreshTask({\n before() {\n genBeforeRefresh(__originStyle, self, root, self.target);\n self.__clean();\n },\n after(diff) {\n self.__assigning = false;\n self.__frameCb(diff);\n task(diff);\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n this.__playState = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let { style, target, keys } = this;\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(change.GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let { duration, iterations, delay } = this;\n this.__playState = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += delay;\n }\n // 超过时间长度需要累加次数\n while(v > duration && this.playCount < iterations - 1) {\n this.__playCount++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n this.__nextTime = v;\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __cancelTask() {\n frame.offFrame(this.__enterFrame);\n this.__playCb = null;\n }\n\n __destroy(sync) {\n let self = this;\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean && self.__clean();\n self.__target = null;\n }\n else {\n frame.nextFrame({\n before() {\n // 尚未初始化的清除\n self.__clean && self.__clean();\n self.__target = null;\n },\n });\n }\n self.__startTime = null;\n self.__isDestroyed = true;\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__target;\n }\n\n get root() {\n return this.__root;\n }\n\n get keys() {\n return this.__keys;\n }\n\n get style() {\n return this.__style;\n }\n\n get list() {\n return this.__list;\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__duration;\n }\n\n set duration(v) {\n this.__duration = Math.max(0, parseFloat(v) || 0);\n }\n\n get delay() {\n return this.__delay;\n }\n\n set delay(v) {\n this.__delay = Math.max(0, parseFloat(v) || 0);\n }\n\n get endDelay() {\n return this.__endDelay;\n }\n\n set endDelay(v) {\n this.__endDelay = Math.max(0, parseFloat(v) || 0);\n }\n\n get fps() {\n return this.__fps;\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n if(v <= 0) {\n v = 60;\n }\n this.__fps = v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__iterations;\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n this.__iterations = v;\n }\n\n get fill() {\n return this.__fill;\n }\n\n set fill(v) {\n this.__fill = v || 'none';\n if(this.playState === 'running') {\n this.pause(true);\n this.resume();\n }\n }\n\n get direction() {\n return this.__direction;\n }\n\n set direction(v) {\n this.__direction = v || 'normal';\n if(this.playState === 'running') {\n this.pause(true);\n this.resume();\n }\n }\n\n get frames() {\n return this.__frames;\n }\n\n get framesR() {\n return this.__framesR;\n }\n\n get playbackRate() {\n return this.__playbackRate;\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n this.__playbackRate = v;\n }\n\n get easing() {\n return this.__easing;\n }\n\n get startTime() {\n return this.__startTime;\n }\n\n get currentTime() {\n return this.__currentTime;\n }\n\n set currentTime(v) {\n v = parseFloat(v) || 0;\n if(v >= 0) {\n this.__currentTime = this.__nextTime = v;\n }\n }\n\n get pending() {\n return this.playState !== 'running';\n }\n\n get finished() {\n return this.playState === 'finished';\n }\n\n get playState() {\n return this.__playState;\n }\n\n get playCount() {\n return this.__playCount;\n }\n\n // set playCount(v) {\n // this.__playCount = Math.max(0, parseInt(v) || 0);\n // }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n get animating() {\n let { playState } = this;\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || this.__stayEnd();\n }\n\n get spfLimit() {\n return this.__spfLimit;\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n this.__spfLimit = Math.max(v, parseInt(v) || 0);\n }\n else {\n this.__spfLimit = !!v;\n }\n }\n\n get assigning() {\n return this.__assigning;\n }\n\n get currentFrames() {\n return this.__currentFrames;\n }\n\n get currentFrame() {\n return this.__currentFrame;\n }\n}\n\nexport default Animation;\n","import change from './change';\n\nconst ENUM = {\n // 低4位表示repaint级别\n NONE: 0, // 0\n TRANSLATE_X: 1, // 1\n TRANSLATE_Y: 2, // 10\n TRANSFORM: 4, // 100\n OPACITY: 8, // 1000\n FILTER: 16, // 10000\n VISIBILITY: 32, // 100000\n REPAINT: 64, // 1000000\n\n // 高位表示reflow\n REFLOW: 128, // 10000000\n};\n\nconst TRANSFORMS = {\n // translateX: true,\n // translateY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n transform: true,\n transformOrigin: true,\n};\n\nlet o = Object.assign({\n contain(lv, value) {\n return (lv & value) > 0;\n },\n /**\n * 得出等级\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(k === 'translateX') {\n return ENUM.TRANSLATE_X;\n }\n else if(k === 'translateY') {\n return ENUM.TRANSLATE_Y;\n }\n else if(TRANSFORMS.hasOwnProperty(k)) {\n return ENUM.TRANSFORM;\n }\n else if(k === 'opacity') {\n return ENUM.OPACITY;\n }\n else if(k === 'filter') {\n return ENUM.FILTER;\n }\n if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n}, ENUM);\no.TRANSFORMS = TRANSFORMS;\n\nexport default o;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096];\nlet NUMBER = [8, 8, 8, 8, 8, 8, 8, 4, 2, 1];\nlet MAX = 4096;\nconst HASH = {};\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n let offScreen = this.__canvas = inject.getCacheCanvas(size, size);\n if(offScreen) {\n this.__offScreen = offScreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n this.grid[pos] = 1;\n this.__free++;\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get size() {\n return this.__size;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offScreen() {\n return this.__offScreen;\n }\n\n get canvas() {\n return this.offScreen.canvas;\n }\n\n get ctx() {\n return this.offScreen.ctx;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH[s] = HASH[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offScreen) {\n console.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set MAX(v) {\n let n = v;\n while(n > 2) {\n n = n % 2;\n }\n if(n !== 0) {\n console.error('Page max-size must be a multiple of 2');\n return;\n }\n if(v < 8) {\n console.error('Page max-size must >= 8');\n return;\n }\n MAX = v;\n n = 1;\n SIZE = [];\n NUMBER = [];\n while(true) {\n SIZE.unshift(v);\n NUMBER.unshift(n);\n v >>= 1;\n // canvas太大初始化会卡,这里限制8个\n if(n < 8) {\n n <<= 1;\n }\n if(v < 8) {\n break;\n }\n }\n }\n\n static get MAX() {\n return MAX;\n }\n}\n\nexport default Page;\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport blur from '../style/blur';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\n\nclass Cache {\n constructor(w, h, bbox, page, pos) {\n this.__init(w, h, bbox, page, pos);\n }\n\n __init(w, h, bbox, page, pos) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n // 四周各+1px的扩展\n this.__coords = [x + 1, y + 1];\n if(page.canvas) {\n this.__enabled = true;\n let ctx = page.ctx;\n ctx.setTransform([1, 0, 0, 1, 0, 0]);\n ctx.globalAlpha = 1;\n if(typeof karas !== 'undefined' && karas.debug) {\n page.canvas.setAttribute('size', page.size);\n ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';\n ctx.beginPath();\n ctx.rect(x + 1, y + 1, page.size - 2, page.size - 2);\n ctx.closePath();\n ctx.fill();\n }\n }\n }\n\n __appendData(x1, y1) {\n this.x1 = x1; // padding原点坐标\n this.y1 = y1;\n let [xc, yc] = this.coords;\n let bbox = this.bbox;\n this.dx = xc - bbox[0]; // cache坐标和box原点的差值\n this.dy = yc - bbox[1];\n this.dbx = x1 - bbox[0];\n this.dby = y1 - bbox[1];\n }\n\n clear() {\n let ctx = this.ctx;\n if(this.enabled && ctx && this.available) {\n ctx.setTransform([1, 0, 0, 1, 0, 0]);\n let [x, y] = this.coords;\n let size = this.page.size;\n ctx.clearRect(x - 1, y - 1, size, size);\n }\n this.__available = false;\n }\n\n release() {\n if(this.enabled) {\n this.clear();\n this.page.del(this.pos);\n this.__page = null;\n this.__enabled = false;\n }\n }\n\n reset(bbox) {\n // 尺寸没变复用之前的并清空\n if(util.equalArr(this.bbox, bbox) && this.enabled) {\n this.clear();\n return;\n }\n this.release();\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n w += 2;\n h += 2;\n // 防止边的精度问题四周各+1px,宽高即+2px\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n this.__enabled = false;\n return;\n }\n let { page, pos } = res;\n this.__init(w, h, bbox, page, pos);\n }\n\n // 是否功能可用,生成离屏canvas及尺寸超限\n get enabled() {\n return this.__enabled;\n }\n\n // 是否有可用缓存内容\n get available() {\n return this.enabled && this.__available;\n }\n\n get bbox() {\n return this.__bbox;\n }\n\n get page() {\n return this.__page;\n }\n\n get canvas() {\n return this.page.canvas;\n }\n\n get ctx() {\n return this.page.ctx;\n }\n\n get size() {\n return this.page.size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get pos() {\n return this.__pos;\n }\n\n get coords() {\n return this.__coords;\n }\n\n static getInstance(bbox) {\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n w += 2;\n h += 2;\n // 防止边的精度问题四周各+1px,宽高即+2px\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n return;\n }\n let { page, pos } = res;\n return new Cache(w, h, bbox, page, pos);\n }\n\n static genMask(cache) {\n let { size, x1, y1, width, height } = cache;\n let offScreen = inject.getCacheCanvas(width, height);\n offScreen.coords = [1, 1];\n offScreen.size = size;\n offScreen.x1 = x1;\n offScreen.y1 = y1;\n offScreen.dbx = cache.dbx;\n offScreen.dby = cache.dby;\n offScreen.width = width;\n offScreen.height = height;\n return offScreen;\n }\n\n /**\n * 复制cache的一块出来单独作为cacheFilter,尺寸边距保持一致,用webgl的滤镜\n * @param cache\n * @param v\n * @returns {{canvas: *, ctx: *, release(): void, available: boolean, draw()}}\n */\n static genOffScreenBlur(cache, v) {\n let { coords: [x, y], size, canvas, x1, y1, width, height } = cache;\n let offScreen = inject.getCacheCanvas(width, height);\n offScreen.ctx.drawImage(canvas, x - 1, y - 1, width, height, 0, 0, width, height);\n offScreen.draw();\n let cacheFilter = inject.getCacheWebgl(width, height);\n blur.gaussBlur(offScreen, cacheFilter, v, width, height);\n cacheFilter.coords = [1, 1];\n cacheFilter.size = size;\n cacheFilter.x1 = x1;\n cacheFilter.y1 = y1;\n cacheFilter.dbx = cache.dbx;\n cacheFilter.dby = cache.dby;\n cacheFilter.width = width;\n cacheFilter.height = height;\n return cacheFilter;\n }\n\n /**\n * bbox变化时直接用老的cache内容重设bbox\n * @param cache\n * @param bbox\n */\n static updateCache(cache, bbox) {\n let old = cache.bbox;\n if(!util.equalArr(bbox, old)) {\n let dx = old[0] - bbox[0];\n let dy = old[1] - bbox[1];\n let newCache = Cache.getInstance(bbox);\n if(newCache && newCache.enabled) {\n let { coords: [ox, oy], canvas, width, height } = cache;\n let { coords: [nx, ny] } = newCache;\n newCache.x1 = cache.x1;\n newCache.y1 = cache.y1;\n newCache.dx = cache.dx + dx;\n newCache.dy = cache.dy + dy;\n newCache.dbx = cache.dbx + dx;\n newCache.dby = cache.dby + dy;\n newCache.ctx.drawImage(canvas, ox - 1, oy - 1, width, height, dx + nx - 1, dy + ny - 1, width, height);\n newCache.__available = true;\n cache.release();\n return newCache;\n }\n }\n else {\n return cache;\n }\n }\n\n static drawCache(source, target, transform, matrix, tfo, inverse) {\n let { coords: [tx, ty], x1, y1, ctx, dbx, dby } = target;\n let { coords: [x, y], canvas, x1: x12, y1: y12, dbx: dbx2, dby: dby2, width, height } = source;\n let dx = tx + x12 - x1 + dbx - dbx2;\n let dy = ty + y12 - y1 + dby - dby2;\n if(transform && matrix && tfo) {\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n matrix = mx.multiply(matrix, m);\n if(inverse) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(matrix, inverse)) {\n matrix = [1, 0, 0, 1, 0, 0];\n }\n else {\n inverse = mx.inverse(inverse);\n matrix = mx.multiply(matrix, inverse);\n }\n }\n ctx.setTransform(...matrix);\n }\n ctx.drawImage(canvas, x - 1, y - 1, width, height, dx - 1, dy - 1, width, height);\n }\n\n static drawMask(target, next, transform, tfo) {\n let cacheMask = Cache.genMask(target);\n let list = [];\n while(next && (next.isMask || next.isClip)) {\n list.push(next);\n next = next.next;\n }\n let { coords: [x, y], ctx, dbx, dby } = cacheMask;\n tfo[0] += x + dbx;\n tfo[1] += y + dby;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n let cacheFilter = item.__cacheFilter, cache = item.__cache;\n let source = cacheFilter && cacheFilter.available && cacheFilter;\n if(!source) {\n source = cache && cache.available && cache;\n }\n if(source) {\n ctx.globalAlpha = item.__opacity;\n Cache.drawCache(\n source, cacheMask,\n item.computedStyle.transform,\n [1, 0, 0, 1, 0, 0],\n item.computedStyle.transformOrigin.slice(0),\n inverse\n );\n }\n else {\n console.error('CacheMask is oversize');\n }\n });\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = 'source-in';\n Cache.drawCache(target, cacheMask);\n ctx.globalCompositeOperation = 'source-over';\n cacheMask.draw(ctx);\n return cacheMask;\n }\n}\n\nexport default Cache;\n","import Node from './Node';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport gradient from '../style/gradient';\nimport border from '../style/border';\nimport css from '../style/css';\nimport image from '../style/image';\nimport blur from '../style/blur';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport Animation from '../animate/Animation';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\nimport Cache from '../refresh/Cache';\n\nconst { AUTO, PX, PERCENT, STRING, INHERIT } = unit;\nconst { clone, int2rgba, rgba2int, equalArr, extend, joinArr } = util;\nconst { calRelative } = css;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst TRANSFORM_ALL = level.TRANSFORM | level.TRANSLATE_X | level.TRANSLATE_Y;\n\nfunction renderBorder(renderMode, points, color, ctx, xom, dx, dy) {\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nfunction renderBgc(renderMode, color, x, y, w, h, ctx, xom, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr, method = 'fill') {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr);\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, w, h);\n }\n ctx[method]();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(list) {\n let d = svgPolygon(list);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color]\n ],\n });\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'rect',\n props: [\n ['x', x],\n ['y', y],\n ['width', w],\n ['height', h],\n ['fill', color]\n ],\n });\n }\n }\n}\n\nlet borderRadiusKs = ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'];\nfunction calBorderRadius(w, h, currentStyle, computedStyle) {\n let noRadius = true;\n borderRadiusKs.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item.value > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item.unit === PX) {\n return Math.max(0, item.value);\n }\n else {\n return Math.max(0, item.value * (i ? h : w) * 0.01);\n }\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n borderRadiusKs.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[borderRadiusKs[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBackgroundSize(value, w, h) {\n let res = [];\n value.forEach((item, i) => {\n if(item.unit === PX) {\n res.push(item.value);\n }\n else if(item.unit === PERCENT) {\n res.push(item.value * (i ? h : w) * 0.01);\n }\n else if(item.unit === AUTO) {\n res.push(-1);\n }\n else if(item.unit === STRING) {\n res.push(item.value === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size) {\n if(position.unit === PX) {\n return position.value;\n }\n else if(position.unit === PERCENT) {\n return (container - size) * position.value * 0.01;\n }\n return 0;\n}\n\nfunction renderBoxShadow(renderMode, ctx, defs, data, xom, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight) {\n let [x, y, blur, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(blur) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1, y4],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (blur > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = mx.int2convolution(blur);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nfunction empty() {}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n this.__refreshLevel = level.REFLOW;\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n }\n\n // 获取margin/padding的实际值\n __mp(currentStyle, computedStyle, w) {\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left',\n ].forEach(k => {\n let a = 'margin' + k;\n let b = 'padding' + k;\n computedStyle[a] = this.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(mp, w) {\n if(mp.unit === PX) {\n return mp.value;\n }\n else if(mp.unit === PERCENT) {\n return mp.value * w * 0.01;\n }\n return 0;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,比如flex列计算时\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, !this.parent);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle } = this;\n let {\n display,\n width,\n position,\n } = currentStyle;\n this.__refreshLevel = level.REFLOW;\n this.__cancelCache();\n if(isDestroyed || display === 'none') {\n this.__width = this.__height = computedStyle.width = computedStyle.height = 0;\n return;\n }\n this.__layoutData = clone(data);\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n if(width.unit !== AUTO) {\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n this.__ox = this.__oy = 0;\n // 3种布局,默认block\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inline') {\n this.__layoutInline(data, isVirtual);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { top, right, bottom, left } = currentStyle;\n let { parent } = this;\n if(top.unit !== AUTO) {\n let n = calRelative(currentStyle, 'top', top, parent);\n this.__offsetY(n);\n computedStyle.top = n;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n let n = calRelative(currentStyle, 'bottom', bottom, parent);\n this.__offsetY(-n);\n computedStyle.bottom = n;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n if(left.unit !== AUTO) {\n let n = calRelative(currentStyle, 'left', left, parent, true);\n this.__offsetX(n);\n computedStyle.left = n;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n let n = calRelative(currentStyle, 'right', right, parent, true);\n this.__offsetX(-n);\n computedStyle.right = n;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n }\n else if(currentStyle.position !== 'absolute') {\n computedStyle.top = computedStyle.bottom = computedStyle.left = computedStyle.right = 'auto';\n }\n // 计算结果存入computedStyle\n computedStyle.width = this.width;\n computedStyle.height = this.height;\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records = ac.__records.concat(ar.list);\n }\n // 自动播放进入列表开始播放\n else {\n ac.__auto = ac.__auto.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data) {\n let { x, y, w, h, w2, h2 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n else if(width.unit !== AUTO) {\n fixedWidth = true;\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(height.unit !== AUTO) {\n fixedHeight = true;\n switch(height.unit) {\n case PX:\n h = height.value;\n break;\n case PERCENT:\n h *= height.value * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n y += borderTopWidth + marginTop + paddingTop;\n data.y = y;\n if(width.unit === AUTO) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height.unit === AUTO) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n position,\n marginLeft,\n marginRight,\n width,\n } = style;\n if(position !== 'absolute' && width !== AUTO && marginLeft.unit === AUTO && marginRight.unit === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calCache(renderMode, lv, ctx, defs, parent, __cacheStyle, currentStyle, computedStyle,\n sx, sy, innerWidth, innerHeight, outerWidth, outerHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n x1, x2, x3, x4, y1, y2, y3, y4) {\n let matrixCache = __cacheStyle.matrix;\n // tx/ty变化特殊优化\n if(matrixCache && lv < level.REFLOW && !level.contain(lv, level.TRANSFORM)) {\n let x = 0, y = 0;\n if(level.contain(lv, level.TRANSLATE_X)) {\n let v = currentStyle.translateX;\n if(util.isNil(v)) {\n v = 0;\n }\n else if(v.unit === PERCENT) {\n v = v.value * this.outerWidth * 0.01;\n }\n else {\n v = v.value;\n }\n x = v - (computedStyle.translateX || 0);\n computedStyle.translateX = v;\n }\n if(level.contain(lv, level.TRANSLATE_Y)) {\n let v = currentStyle.translateY;\n if(util.isNil(v)) {\n v = 0;\n }\n else if(v.unit === PERCENT) {\n v = v.value * this.outerHeight * 0.01;\n }\n else {\n v = v.value;\n }\n y = v - (computedStyle.translateY || 0);\n computedStyle.translateY = v;\n }\n matrixCache[4] += x;\n matrixCache[5] += y;\n __cacheStyle.matrix = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(__cacheStyle.transformOrigin === undefined) {\n __cacheStyle.transformOrigin = true;\n matrixCache = null;\n computedStyle.transformOrigin = tf.calOrigin(currentStyle.transformOrigin, outerWidth, outerHeight);\n }\n if(__cacheStyle.transform === undefined\n || __cacheStyle.translateX === undefined\n || __cacheStyle.translateY === undefined\n || __cacheStyle.rotateZ === undefined\n || __cacheStyle.scaleX === undefined\n || __cacheStyle.scaleY === undefined\n || __cacheStyle.skewX === undefined\n || __cacheStyle.skewY === undefined) {\n __cacheStyle.transform\n = __cacheStyle.translateX\n = __cacheStyle.translateY\n = __cacheStyle.rotateZ\n = __cacheStyle.scaleX\n = __cacheStyle.scaleY\n = __cacheStyle.skewX\n = __cacheStyle.skewY\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle.transform) {\n matrix = tf.calMatrix(currentStyle.transform, outerWidth, outerHeight);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n 'translateX',\n 'translateY',\n 'rotateZ',\n 'rotate',\n 'skewX',\n 'skewY',\n 'scaleX',\n 'scaleY',\n ].forEach(k => {\n let v = currentStyle[k];\n if(util.isNil(v)) {\n return;\n }\n computedStyle[k] = v.value;\n // scale为1和其它为0避免计算浪费\n let isScale = k.indexOf('scale') > -1;\n if(v.value === 1 && isScale || !isScale && v.value === 0) {\n return;\n }\n if(v.unit === PERCENT) {\n if(k === 'translateX') {\n computedStyle[k] = v.value * outerWidth * 0.01;\n }\n else if(k === 'translateY') {\n computedStyle[k] = v.value * outerHeight * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, outerWidth, outerHeight);\n }\n }\n this.__matrix = computedStyle.transform = matrix || [1, 0, 0, 1, 0, 0];\n }\n }\n if(lv >= level.REPAINT) {\n if(__cacheStyle.backgroundPositionX === undefined) {\n __cacheStyle.backgroundPositionX = true;\n let {\n backgroundPositionX,\n } = currentStyle;\n computedStyle.backgroundPositionX = backgroundPositionX.unit === PX\n ? backgroundPositionX.value : backgroundPositionX.value * innerWidth + '%';\n }\n if(__cacheStyle.backgroundPositionY === undefined) {\n __cacheStyle.backgroundPositionY = true;\n let {\n backgroundPositionY,\n } = currentStyle;\n computedStyle.backgroundPositionY = backgroundPositionY.unit === PX\n ? backgroundPositionY.value : backgroundPositionY.value * innerWidth + '%';\n }\n if(__cacheStyle.backgroundSize === undefined) {\n __cacheStyle.backgroundSize = true;\n computedStyle.backgroundSize = calBackgroundSize(currentStyle.backgroundSize, innerWidth, innerHeight);\n }\n if(__cacheStyle.backgroundImage === undefined) {\n let backgroundImage = computedStyle.backgroundImage = currentStyle.backgroundImage;\n // 防止隐藏不加载背景图\n if(util.isString(backgroundImage)) {\n __cacheStyle.backgroundImage = true;\n let loadBgi = this.__loadBgi;\n let cache = inject.IMG[backgroundImage];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = backgroundImage;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n if(loadBgi.url !== backgroundImage) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = backgroundImage;\n loadBgi.source = null;\n inject.measureImg(backgroundImage, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.__isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n let node = this;\n let root = node.root;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n before() {\n root.__addUpdate({\n node,\n focus: level.REPAINT,\n });\n },\n });\n }\n }, {\n width: innerWidth,\n height: innerHeight,\n });\n }\n }\n else if(backgroundImage && backgroundImage.k) {\n __cacheStyle.backgroundImage = this.__gradient(renderMode, ctx, defs, x2, y2, x3, y3, innerWidth, innerHeight, backgroundImage);\n }\n }\n if(__cacheStyle.boxShadow === undefined) {\n __cacheStyle.boxShadow = true;\n computedStyle.boxShadow = currentStyle.boxShadow;\n }\n // 这些直接赋值的不需要再算缓存\n [\n 'opacity',\n 'zIndex',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundRepeat',\n 'filter',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n [\n 'backgroundColor',\n 'borderTopColor',\n 'borderRightColor',\n 'borderBottomColor',\n 'borderLeftColor',\n ].forEach(k => {\n if(__cacheStyle[k] === undefined) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k].value);\n }\n });\n // 圆角边计算\n if(__cacheStyle.borderTopLeftRadius === undefined\n || __cacheStyle.borderTopRightRadius === undefined\n || __cacheStyle.borderBottomRightRadius === undefined\n || __cacheStyle.borderBottomLeftRadius === undefined) {\n __cacheStyle.borderTopLeftRadius\n = __cacheStyle.borderTopRightRadius\n = __cacheStyle.borderBottomRightRadius\n = __cacheStyle.borderBottomLeftRadius\n = true;\n calBorderRadius(outerWidth, outerHeight, currentStyle, computedStyle);\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n __cacheStyle['border' + k] = undefined;\n });\n }\n let {\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n } = computedStyle;\n // width/style/radius影响border,color不影响渲染缓存\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n let k2 = 'border' + k;\n let kw = k2 + 'Width';\n let ks = k2 + 'Style';\n if(__cacheStyle[kw] === undefined) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(__cacheStyle[ks] === undefined) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(__cacheStyle[k2] === undefined) {\n if(k === 'Top') {\n if(borderTopWidth > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 0,\n borderTopLeftRadius, borderTopRightRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k === 'Right') {\n if(borderRightWidth > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 1,\n borderTopRightRadius, borderBottomRightRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k === 'Bottom') {\n if(borderBottomWidth > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 2,\n borderBottomLeftRadius, borderBottomRightRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k === 'Left') {\n if(borderLeftWidth > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 3,\n borderTopLeftRadius, borderBottomLeftRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n }\n else {\n if(level.contain(lv, level.OPACITY)) {\n computedStyle.opacity = currentStyle.opacity;\n }\n if(level.contain(lv, level.FILTER)) {\n computedStyle.filter = currentStyle.filter;\n }\n }\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle.fontStyle.unit === INHERIT) {\n computedStyle.fontStyle = parent ? parentComputedStyle.fontStyle : 'normal';\n }\n else if(!__cacheStyle.fontStyle) {\n computedStyle.fontStyle = currentStyle.fontStyle.value;\n }\n __cacheStyle.fontStyle = computedStyle.fontStyle;\n if(currentStyle.color.unit === INHERIT) {\n computedStyle.color = parent ? parentComputedStyle.color : [0, 0, 0, 1];\n __cacheStyle.color = int2rgba(computedStyle.color);\n }\n else if(!__cacheStyle.color) {\n computedStyle.color = rgba2int(currentStyle.color.value);\n __cacheStyle.color = int2rgba(computedStyle.color);\n }\n if(currentStyle.visibility.unit === INHERIT) {\n computedStyle.visibility = parent ? parentComputedStyle.visibility : 'visible';\n }\n else if(!__cacheStyle.visibility) {\n computedStyle.visibility = currentStyle.visibility.value;\n }\n __cacheStyle.visibility = computedStyle.visibility;\n if(currentStyle.pointerEvents.unit === INHERIT) {\n computedStyle.pointerEvents = parent ? parentComputedStyle.pointerEvents : 'auto';\n }\n else if(!__cacheStyle.pointerEvents) {\n computedStyle.pointerEvents = currentStyle.pointerEvents.value;\n }\n __cacheStyle.pointerEvents = computedStyle.pointerEvents;\n if(!matrixCache) {\n let tfo = computedStyle.transformOrigin.slice(0);\n tfo[0] += sx;\n tfo[1] += sy;\n __cacheStyle.matrix = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n }\n // 决定是否缓存位图的指数,有内容就缓存,空容器无内容\n if(renderMode === mode.CANVAS) {\n if(lv < level.REPAINT) {\n return this.__hasContent;\n }\n let backgroundImage = __cacheStyle.backgroundImage;\n if(util.isString(backgroundImage)) {\n return true;\n }\n if(computedStyle.backgroundColor[3] > 0) {\n return true;\n }\n else if(backgroundImage && backgroundImage.k) {\n return true;\n }\n for(let list = ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[k + 'Width'] > 0 && computedStyle[k + 'Color'][3] > 0) {\n return true;\n }\n }\n let boxShadow = computedStyle.boxShadow;\n if(Array.isArray(boxShadow)) {\n for(let i = 0, len = boxShadow.length; i < len; i++) {\n let item = boxShadow[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n // borderRadius用5,只要有bgc或border就会超过\n for(let i = 0, len = borderRadiusKs.length; i < len; i++) {\n let v = computedStyle[borderRadiusKs[i]];\n if(v[0] > 0 && v[1] > 0) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param lv\n * @param ctx\n * @param defs\n */\n render(renderMode, lv, ctx, defs) {\n let {\n isDestroyed,\n currentStyle,\n computedStyle,\n __cacheStyle,\n root,\n __cache: cache,\n __cacheTotal: cacheTotal,\n } = this;\n // 渲染完认为完全无变更,等布局/动画/更新重置\n this.__refreshLevel = level.NONE;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明 level.NONE) {\n let { __sx: x, __sy: y, parent } = this;\n this.__calCache(renderMode, lv, ctx, defs, parent, __cacheStyle, currentStyle, computedStyle, x, y);\n let p;\n if(level.contain(lv, TRANSFORM_ALL)) {\n p = p || this.domParent;\n let matrix = __cacheStyle.matrix;\n if(p) {\n matrix = mx.multiply(p.matrixEvent, matrix);\n }\n this.__matrixEvent = matrix;\n }\n if(level.contain(lv, level.OPACITY)) {\n let opacity = computedStyle.opacity;\n p = p || this.domParent;\n if(p) {\n opacity *= p.__opacity;\n }\n this.__opacity = opacity;\n }\n if(level.contain(lv, level.FILTER) && Array.isArray(computedStyle.filter)) {\n computedStyle.filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n this.__blurValue = v;\n let bbox = this.bbox;\n if(cache) {\n this.__cache = Cache.updateCache(cache, bbox);\n }\n else {\n this.__cache = Cache.getInstance(bbox);\n }\n }\n });\n }\n if(computedStyle.visibility === 'hidden') {\n return { canCache: canCache || !this.visibilityAnimating };\n }\n }\n // 有cacheTotal省略判断有效动画\n return { canCache: canCache || !this.availableAnimating };\n }\n // 使用sx和sy渲染位置,考虑了relative和translate影响\n let {\n sx: x,\n sy: y,\n width,\n height,\n innerWidth,\n innerHeight,\n outerWidth,\n outerHeight,\n } = this;\n this.__sx = x;\n this.__sy = y;\n let {\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth,\n borderBottomWidth,\n } = computedStyle;\n let x1 = x + marginLeft;\n let x2 = x1 + borderLeftWidth;\n let x3 = x2 + width + paddingLeft + paddingRight;\n let x4 = x3 + borderRightWidth;\n let y1 = y + marginTop;\n let y2 = y1 + borderTopWidth;\n let y3 = y2 + height + paddingTop + paddingBottom;\n let y4 = y3 + borderBottomWidth;\n let res = { x1, x2, x3, x4, y1, y2, y3, y4 };\n // 防止cp直接返回cp嵌套,拿到真实dom的parent\n let p = this.domParent;\n // 计算好cacheStyle的内容,以及位图缓存指数\n let hasContent = this.__hasContent = this.__calCache(renderMode, lv, ctx, defs, this.parent,\n __cacheStyle, currentStyle, computedStyle,\n x, y, innerWidth, innerHeight, outerWidth, outerHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n x1, x2, x3, x4, y1, y2, y3, y4\n );\n let {\n backgroundColor,\n borderTopColor,\n borderRightColor,\n borderBottomColor,\n borderLeftColor,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n backgroundRepeat,\n backgroundImage,\n opacity,\n filter,\n backgroundSize,\n boxShadow,\n } = computedStyle;\n // 先设置透明度,canvas可以向上累积\n if(renderMode === mode.CANVAS) {\n if(p) {\n opacity *= p.__opacity;\n }\n this.__opacity = opacity;\n }\n else if(renderMode === mode.SVG) {\n if(opacity === 1) {\n delete virtualDom.opacity;\n }\n else {\n virtualDom.opacity = opacity;\n }\n }\n // canvas/svg/事件需要3种不同的matrix\n let matrix = __cacheStyle.matrix;\n let renderMatrix = this.__renderMatrix = matrix;\n // 变换对事件影响,canvas要设置渲染\n if(p) {\n matrix = mx.multiply(p.matrixEvent, matrix);\n }\n this.__matrixEvent = matrix;\n if(renderMode === mode.SVG) {\n // svg可以没变化省略计算,因为只相对于自身\n if(!level.contain(lv, TRANSFORM_ALL) && lv < level.REPAINT) {}\n else if(!equalArr(renderMatrix, [1, 0, 0, 1, 0, 0])) {\n virtualDom.transform = 'matrix(' + joinArr(renderMatrix, ',') + ')';\n }\n else {\n delete virtualDom.transform;\n }\n }\n // 隐藏不渲染,依然注意canCache在canvas/svg下意义不同\n if(visibility === 'hidden') {\n if(renderMode === mode.CANVAS) {\n return { ...res, break: true, canCache: !this.visibilityAnimating };\n }\n }\n if(renderMode === mode.SVG) {\n virtualDom.visibility = visibility;\n }\n // 无内容或者无影响动画视为可缓存本身\n let canCache = !hasContent || !this.availableAnimating;\n // 无缓存重新渲染时是否使用缓存\n let dx = 0, dy = 0;\n if(root.cache && renderMode === mode.CANVAS) {\n // 置空防止原型链查找性能\n this.__cache = this.__cacheTotal = this.__cacheFilter = this.__cacheMask = null;\n let isGeom = this.tagName.charAt(0) === '$';\n let isImg = this.tagName.toLowerCase() === 'img';\n // 无内容可释放并提前跳出,geom特殊判断,因为后面子类会绘制矢量,img也特殊判断\n if(!hasContent) {\n if(!isGeom && cache && cache.available) {\n cache.release();\n }\n // 无内容且lv变化小geom可以提前跳出,普通dom直接跳出\n if(lv < level.REPAINT && isGeom) {\n return { ...res, break: true, canCache };\n }\n if(!isImg) {\n return { ...res, canCache };\n }\n }\n // 有缓存情况快速使用位图缓存不再继续,filter要更新bbox范围,排除geom,因为是整屏\n if(cache && cache.available && lv < level.REPAINT) {\n if(level.contain(lv, level.FILTER)) {\n cache = this.__cache = Cache.updateCache(cache, this.bbox);\n }\n return { ...res, break: true, canCache, cache };\n }\n // 新生成根据最大尺寸,排除margin从border开始还要考虑阴影滤镜等,geom单独在dom里做\n if((!cache || !cache.available)) {\n let bbox = this.bbox;\n if(cache) {\n cache.reset(bbox);\n }\n else {\n cache = Cache.getInstance(bbox);\n }\n // 有可能超过最大尺寸限制不使用缓存\n if(cache && cache.enabled) {\n this.__cache = cache;\n cache.__bbox = bbox;\n cache.__appendData(x1, y1);\n let dbx = cache.dbx, dby = cache.dby;\n ctx = cache.ctx;\n let [xc, yc] = cache.coords;\n dx = cache.dx;\n dy = cache.dy;\n // 重置ctx为cache的,以及绘制坐标为cache的区域\n res.x1 = x1 = xc + dbx;\n res.y1 = y1 = yc + dby;\n if(dx) {\n res.x2 = x2 += dx;\n res.x3 = x3 += dx;\n res.x4 = x4 += dx;\n }\n if(dy) {\n res.y2 = y2 += dy;\n res.y3 = y3 += dy;\n res.y4 = y4 += dy;\n }\n }\n // 更新后可能超了需释放\n else if(this.__cache) {\n this.__cache.release();\n this.__cache = null;\n }\n }\n // 无离屏功能视为不可缓存本身\n if(!cache) {\n canCache = false;\n }\n }\n // 无cache时canvas的blur需绘制到离屏上应用后反向绘制回来,有cache在Dom里另生成一个filter的cache\n let offScreen;\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n this.__blurValue = v;\n // geom由dom看管,做了替换工作,以便自定义geom时render()不感知离屏过程\n if(renderMode === mode.CANVAS && v > 0 && (!cache || !cache.enabled) && this.tagName.charAt(0) !== '$') {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$blur$$__');\n if(c.ctx) {\n offScreen = {\n ctx,\n blur: v,\n };\n offScreen.target = c;\n ctx = c.ctx;\n }\n }\n else if(renderMode === mode.SVG\n && (lv >= level.REFLOW || level.contain(lv, level.FILTER))) {\n // 模糊框卷积尺寸 #66\n if(v > 0) {\n let d = mx.int2convolution(v);\n let id = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feGaussianBlur',\n props: [\n ['stdDeviation', v],\n ],\n }\n ],\n });\n virtualDom.filter = 'url(#' + id + ')';\n }\n else {\n delete virtualDom.filter;\n }\n }\n }\n });\n }\n if(virtualDom && virtualDom.filter && this.__blurValue <= 0) {\n delete virtualDom.filter;\n }\n // svg在非首次有vd缓存的情况下,本次绘制 0) {\n renderBgc(renderMode, __cacheStyle.backgroundColor, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n if(util.isString(backgroundImage)) {\n let loadBgi = this.__loadBgi;\n if(loadBgi.url === backgroundImage) {\n let source = loadBgi.source;\n // 无source不绘制\n if(source) {\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize;\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > innerWidth && height > innerHeight) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w >= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(width > innerWidth) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(height > innerHeight) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(innerWidth > width && innerHeight > height) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(innerWidth > width) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(innerHeight > height) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = x2 + calBackgroundPosition(currentStyle.backgroundPositionX, innerWidth, w);\n let bgY = y2 + calBackgroundPosition(currentStyle.backgroundPositionY, innerHeight, h);\n // 超出尺寸模拟mask截取\n let needMask = bgX < x2 || bgY < y2 || w > innerWidth || h > innerHeight;\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgX - x2;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = x2 + innerWidth - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgY - y2;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = y2 + innerHeight - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < x2) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > x2 + innerWidth) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < y2) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > y2 + innerHeight) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n if(needMask) {\n ctx.save();\n renderBgc(renderMode, '#FFF', x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, innerWidth, innerHeight);\n let props = [\n ['xlink:href', backgroundImage],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height]\n ];\n let needResize;\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(matrix, ',') + ')']);\n }\n if(needMask) {\n let id = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'rect',\n props: [\n ['x', x2],\n ['y', y2],\n ['width', innerWidth],\n ['height', innerHeight],\n ['fill', '#FFF']\n ],\n }],\n });\n this.virtualDom.bbClip = 'url(#' + id + ')';\n }\n // 先画不考虑repeat的中心声明的\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], innerWidth, innerHeight);\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n copy[5][1] = 'matrix(' + joinArr(matrix, ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n }\n else if(backgroundImage.k) {\n renderBgc(renderMode, __cacheStyle.backgroundImage, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n renderBoxShadow(renderMode, ctx, defs, item, this, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderTop, __cacheStyle.borderTopColor, ctx, this, dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderRight, __cacheStyle.borderRightColor, ctx, this, dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderBottom, __cacheStyle.borderBottomColor, ctx, this, dx, dy);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderLeft, __cacheStyle.borderLeftColor, ctx, this, dx, dy);\n }\n if(cache && cache.enabled) {\n cache.__available = true;\n }\n if(renderMode === mode.CANVAS) {\n return { ...res, canCache, cache, offScreen };\n }\n // svg前面提前跳出,到这一定是>=REPAINT的变化\n else if(renderMode === mode.SVG) {\n return { canCache: false };\n }\n }\n\n __renderByMask(renderMode, lv, ctx, defs) {\n let { next, root, __hasMask, __hasClip } = this;\n if(__hasMask === undefined || __hasClip === undefined) {\n __hasMask = this.__hasMask = !!(next && next.isMask);\n __hasClip = this.__hasClip = !!(next && next.isClip);\n }\n // cache情况特殊处理,geom照常绘制,交由dom处理mask\n if((root.cache && renderMode === mode.CANVAS) || (!__hasMask && !__hasClip)) {\n return this.render(renderMode, lv, ctx, defs);\n }\n if(renderMode === mode.CANVAS) {\n let res;\n // canvas借用2个离屏canvas来处理,c绘制本xom,m绘制多个mask\n if(__hasMask) {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$mask1$$__');\n res = this.render(renderMode, lv, c.ctx);\n // 收集之前的mask列表\n let list = [];\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n // 当mask只有1个时,无需生成m,直接在c上即可\n if(list.length === 1) {\n next = list[0];\n c.ctx.globalCompositeOperation = 'destination-in';\n next.render(renderMode, lv, c.ctx, null);\n // 为小程序特殊提供的draw回调,每次绘制调用都在攒缓冲,drawImage另一个canvas时刷新缓冲,需在此时主动flush\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n }\n // 多个借用m绘制mask,用c结合mask获取结果,最终结果再到当前画布\n else {\n let m = inject.getCacheCanvas(width, height, '__$$mask2$$__');\n list.forEach(item => {\n item.render(renderMode, lv, m.ctx, null, true);\n });\n m.draw(m.ctx);\n c.ctx.globalCompositeOperation = 'destination-in';\n c.ctx.drawImage(m.canvas, 0, 0);\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n // 清除\n m.ctx.globalCompositeOperation = 'source-over';\n m.ctx.clearRect(0, 0, width, height);\n m.draw(m.ctx);\n }\n ctx.restore();\n // 清除\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, width, height);\n c.draw(c.ctx);\n }\n // 劫持canvas原生方法使得多个clip矢量连续绘制\n else if(__hasClip) {\n ctx.save();\n ctx.beginPath();\n let fill = ctx.fill;\n let beginPath = ctx.beginPath;\n let closePath = ctx.closePath;\n ctx.fill = ctx.beginPath = ctx.closePath = empty;\n while(next && next.isClip) {\n next.render(renderMode, lv, ctx);\n next = next.next;\n }\n ctx.fill = fill;\n ctx.beginPath = beginPath;\n ctx.closePath = closePath;\n ctx.clip();\n ctx.closePath();\n res = this.render(renderMode, lv, ctx);\n ctx.restore();\n }\n return res;\n }\n else if(renderMode === mode.SVG) {\n let res = this.render(renderMode, lv, ctx, defs);\n // 检查后续mask是否是空,空遮罩不生效\n let isEmpty = true;\n let sibling = next;\n outer:\n while(sibling) {\n let { children } = sibling.virtualDom;\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n for(let j = 0, len = props.length; j < len; j++) {\n let [k, v] = props[i];\n if(k === 'd') {\n if(v) {\n isEmpty = false;\n break outer;\n }\n }\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(__hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(__hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n if(isEmpty || this.computedStyle.display === 'none') {\n return res;\n }\n // 应用mask本身的matrix,以及被遮罩对象的matrix逆\n sibling = next;\n let mChildren = [];\n while(sibling) {\n let { computedStyle: { display, visibility } } = sibling;\n if(display !== 'none' && visibility !== 'hidden') {\n let { children } = sibling.virtualDom;\n mChildren = mChildren.concat(children);\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n let matrix = sibling.__renderMatrix;\n let inverse = mx.inverse(this.__renderMatrix);\n matrix = mx.multiply(matrix, inverse);\n // transform属性放在最后一个省去循环\n let len = props.length;\n if(!len || props[len - 1][0] !== 'transform') {\n props.push(['transform', `matrix(${matrix})`]);\n }\n else {\n props[len - 1][1] = `matrix(${matrix})`;\n }\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(__hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(__hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n let id = defs.add({\n tagName: __hasClip ? 'clipPath' : 'mask',\n props: [],\n children: mChildren,\n });\n id = 'url(#' + id + ')';\n // 作为mask会在defs生成maskId供使用,多个连续mask共用一个id\n if(__hasMask) {\n this.virtualDom.mask = id;\n }\n else if(__hasClip) {\n this.virtualDom.clip = id;\n }\n return res;\n }\n }\n\n __applyCache(renderMode, ctx, tx, ty) {\n let cache = this.__cache;\n if(cache && cache.available) {\n let { coords, canvas, size, dbx, dby } = cache;\n let [x, y] = coords;\n ctx.drawImage(canvas, x - 1, y - 1, size, size, tx - dbx, ty - dby, size, size);\n }\n }\n\n // 简化bbox为2个坐标点形式,并附带matrix计算\n __mergeBbox(matrix, isTop, dx, dy) {\n // 空内容\n let bbox;\n if(this.__cache && this.__cache.available) {\n bbox = this.__cache.bbox.slice(0);\n }\n else {\n bbox = this.bbox;\n }\n if(!isTop) {\n bbox = util.transformBbox(bbox, matrix, dx, dy);\n }\n return bbox;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n let ref = this.props.ref;\n if(ref) {\n let owner = this.host || this.root;\n if(owner && owner.ref[ref]) {\n delete owner.ref[ref];\n }\n }\n this.animationList.forEach(item => item.__destroy());\n this.root.delRefreshTask(this.__loadBgi.cb);\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__matrix = this.__matrixEvent = this.__root = null;\n if(this.__cache) {\n this.__cache.release();\n this.__cache = null;\n }\n if(this.__cacheTotal) {\n this.__cacheTotal.release();\n this.__cacheTotal = null;\n }\n if(this.__cacheFilter) {\n this.__cacheFilter.release();\n this.__cacheFilter = null;\n }\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n e.target = this;\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e) {\n let { x, y } = e;\n let { sx, sy, outerWidth, outerHeight, matrixEvent,\n computedStyle: { pointerEvents } } = this;\n if(pointerEvents === 'none') {\n return;\n }\n let inThis = tf.pointInQuadrilateral(\n x, y,\n sx, sy,\n sx + outerWidth, sy,\n sx + outerWidth, sy + outerHeight,\n sx, sy + outerHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root.__touchstartTarget = this;\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, defs, x2, y2, x3, y3, iw, ih, vs) {\n let { k, v, d, s, z, p } = vs;\n let cx = x2 + iw * 0.5;\n let cy = y2 + ih * 0.5;\n let res;\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, cx, cy, iw, ih);\n res = this.__getLg(renderMode, ctx, defs, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, x2, y2, x3, y3);\n res = this.__getRg(renderMode, ctx, defs, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, defs, gd) {\n if(renderMode === mode.CANVAS) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], item[0]);\n });\n return lg;\n }\n else if(renderMode === mode.SVG) {\n let uuid = defs.add({\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2]\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', item[0]],\n ['offset', item[1] * 100 + '%']\n ],\n };\n }),\n });\n return 'url(#' + uuid + ')';\n }\n }\n\n // canvas清空自身cache,cacheTotal在Root的自底向上逻辑做,svg仅有cacheTotal\n __cancelCache() {\n this.__cacheStyle = {};\n if(this.__cache) {\n this.__cache.release();\n }\n if(this.__cacheTotal) {\n this.__cacheTotal.release();\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 updateStyle(style, cb) {\n let { tagName, root, props, style: os } = this;\n if(root) {\n let hasChange;\n // 先去掉缩写\n let ks = Object.keys(style);\n ks.forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n // 此处仅检测样式是否有效\n for(let i in style) {\n if(style.hasOwnProperty(i)) {\n // 是规定内的合法样式\n if(change.isValid(tagName, i)) {\n if(change.isGeom(tagName, i)) {\n if(!css.equalStyle(i, style[i], props[i], this)) {\n hasChange = true;\n }\n }\n else if(!css.equalStyle(i, style[i], os[i], this)) {\n hasChange = true;\n }\n }\n else {\n delete style[i];\n }\n }\n }\n // 空样式或非法或无改变直接返回\n if(!hasChange) {\n if(util.isFunction(cb)) {\n cb(0);\n }\n return;\n }\n let node = this;\n root.addRefreshTask(node.__task = {\n before() {\n if(node.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node,\n style,\n origin: true, // 标识样式未经过normalize,不同于animate\n overwrite: true, // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n });\n },\n after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n }\n\n animate(list, options) {\n if(this.isDestroyed) {\n return;\n }\n let animation = new Animation(this, list, options);\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n css.computeMeasure(this, isHost);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n deepScan(cb, options) {\n return cb(this, options);\n }\n\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.layoutData.x += diff;\n }\n if(lv !== undefined) {\n this.__refreshLevel |= lv;\n }\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.layoutData.y += diff;\n }\n if(lv !== undefined) {\n this.__refreshLevel |= lv;\n }\n }\n\n __resizeX(diff) {\n this.computedStyle.width = this.__width += diff;\n this.layoutData.w += diff;\n }\n\n __resizeY(diff) {\n this.computedStyle.height = this.__height += diff;\n this.layoutData.h += diff;\n }\n\n __spreadByBoxShadowAndFilter(boxShadow, filter) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, blur, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = mx.int2convolution(blur);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n if(Array.isArray(filter)) {\n for(let i = 0, len = filter.length; i < len; i++) {\n let [k, v] = filter[i];\n if(k === 'blur') {\n let d = mx.int2convolution(v);\n ox = Math.max(ox, d);\n oy = Math.max(oy, d);\n }\n }\n }\n return [ox, oy];\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get innerWidth() {\n let {\n computedStyle: {\n display,\n paddingRight,\n paddingLeft,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.width\n + paddingLeft\n + paddingRight;\n }\n\n get innerHeight() {\n let {\n computedStyle: {\n display,\n paddingTop,\n paddingBottom,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.height\n + paddingTop\n + paddingBottom;\n }\n\n get outerWidth() {\n let {\n computedStyle: {\n display,\n borderLeftWidth,\n borderRightWidth,\n marginRight,\n marginLeft,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerWidth\n + borderLeftWidth\n + borderRightWidth\n + marginLeft\n + marginRight;\n }\n\n get outerHeight() {\n let {\n computedStyle: {\n display,\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerHeight\n + borderTopWidth\n + borderBottomWidth\n + marginTop\n + marginBottom;\n }\n\n // 不考虑margin的范围\n get bbox() {\n let {\n sx, sy, width, height,\n computedStyle: {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n boxShadow,\n filter,\n },\n } = this;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n sx += marginLeft;\n sy += marginTop;\n width += borderLeftWidth + paddingLeft + borderRightWidth + paddingRight;\n height += borderTopWidth + paddingTop + borderBottomWidth + paddingBottom;\n return [sx - ox, sy - oy, sx + width + ox, sy + height + oy];\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 renderMatrix() {\n return this.__renderMatrix;\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 // 除IGNORE外的动画为有效的\n get availableAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n if(!change.isIgnore(transition[i].k)) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n // 除IGNORE/opacity/transform/filter/visibility外的动画为有影响的\n get effectiveAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n let k = transition[i].k;\n if(!change.isIgnore(k) || level.TRANSFORMS.hasOwnProperty(k)\n || k === 'opacity' || k === 'transform' || k === 'filter' || k === 'visibility') {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n // 是否有display的动画,在none时执行其它的都可视为无效,影响缓存\n get displayAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n let k = transition[i].k;\n if(k === 'display') {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n // 是否有visibility的动画,在为hidden时执行其它的都可视为无效,影响缓存\n get visibilityAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n let k = transition[i].k;\n if(k === 'visibility') {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get layoutData() {\n return this.__layoutData;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n}\n\nexport default Xom;\n","class LineGroup {\n constructor(x, y) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__baseLine = 0;\n }\n\n add(item) {\n this.list.push(item);\n }\n\n __calBaseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return baseLine;\n }\n\n verticalAlign() {\n let n = this.__baseLine = this.__calBaseLine();\n // 仅当有2个和以上时才需要vertical对齐调整\n if(this.list.length > 1) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n horizonAlign(diff) {\n this.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n\n get list() {\n return this.__list;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n let width = 0;\n this.list.forEach(item => {\n width += item.outerWidth;\n });\n return width;\n }\n\n get height() {\n let height = 0;\n this.list.forEach(item => {\n height = Math.max(height, item.outerHeight);\n });\n return height;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get marginBottom() {\n let n = 0;\n this.list.forEach(item => {\n n = Math.max(n, item.computedStyle.marginBottom);\n });\n return n;\n }\n}\n\nexport default LineGroup;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import Text from '../node/Text';\nimport tag from '../node/tag';\nimport util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flattenJson({\n children: cd,\n $$type: TYPE_VD,\n });\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\n\nfunction initCp(json, root, owner) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n let vd = build(json, root, owner, owner);\n if(Array.isArray(vd)) {\n relation(owner, vd);\n }\n return vd;\n }\n else {\n return new Text(json);\n }\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param owner\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, owner, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, owner, host));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, inherit, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.placeholder) {\n return json.value;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, owner, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = vd.__tagName || tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用\n json.vd = vd;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = vd;\n });\n }\n // 更新过程中key相同的vd继承动画\n if(inherit) {\n util.extendAnimate(inherit, vd);\n }\n vd.__root = root;\n if(host) {\n vd.__host = host;\n }\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n owner.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children.children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n if(children instanceof Dom) {\n relation(children, children.children);\n }\n // 文字视作为父节点的直接文字子节点\n else if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initCp,\n flattenJson,\n relation,\n build,\n};\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.__state = {};\n this.__isMounted = false;\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n cb.call(self);\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n root.delRefreshTask(self.__task);\n this.__task = {\n before: () => {\n // 标识更新\n self.__nextState = n;\n setUpdateFlag(this);\n },\n after: () => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n __state: true, // 特殊标识来源让root刷新时识别\n };\n root.addRefreshTask(self.__task);\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.__state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n let root = this.root;\n let cd = json || builder.flattenJson(this.render());\n let sr = builder.initCp(cd, root, this, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n console.warn('Component render() return a text, should not inherit style/event');\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr,以及自定义事件\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n }\n else if(sr instanceof Component) {\n // 本身build是递归的,子cp已经初始化了\n console.warn('Component render() return a component: '\n + this.tagName + ' -> ' + sr.tagName\n + ', should not inherit style/event');\n }\n else {\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // shadow指向直接root,shadowRoot考虑到返回Component的递归\n this.__shadow = sr;\n sr.__host = this;\n while(sr instanceof Component) {\n sr = sr.shadowRoot;\n }\n sr.__host = this;\n this.__shadowRoot = sr;\n if(!this.__isMounted) {\n this.__isMounted = true;\n let { componentDidMount } = this;\n if(isFunction(componentDidMount)) {\n root.once(Event.REFRESH, () => {\n componentDidMount.call(this);\n });\n }\n }\n }\n\n render() {\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n let { componentWillUnmount } = this;\n if(isFunction(componentWillUnmount)) {\n componentWillUnmount.call(this);\n this.__isMounted = false;\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__shadow = null;\n this.__shadowRoot = null;\n this.__parent = null;\n }\n\n __emitEvent(e) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n sr.__computeMeasure(renderMode, ctx);\n }\n // 其它类型为Xom或Component\n else {\n sr.__computeMeasure(renderMode, ctx, true, cb);\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\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 prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'innerWidth',\n 'innerHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n 'layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n '__refreshLevel',\n '__cacheTotal',\n '__cache',\n 'bbox',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'deepScan',\n '__cancelCache',\n '__applyCache',\n '__mergeBbox',\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","export default {\n ROOT: 0, // 普通主屏递归渲染\n TOP: 1, // 局部根节点离屏汇总渲染\n CHILD: 2, // 局部根节点的子节点汇总渲染\n};\n","import Xom from '../node/Xom';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport level from '../refresh/level';\nimport refreshMode from '../refresh/mode';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport Cache from '../refresh/Cache';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { int2rgba, isNil } = util;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__isMask = !!this.props.mask;\n this.__isClip = !!this.props.clip;\n let { style, isMask, isClip } = this;\n if(isMask || isClip) {\n style.visibility = 'visible';\n style.background = null;\n style.border = null;\n style.strokeWidth = 0;\n style.stroke = null;\n if(isClip) {\n style.fill = '#FFF';\n style.opacity = 1;\n }\n }\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n this.__cacheProps = {};\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n return w;\n }\n\n __calAutoBasis(isDirectionRow) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit !== AUTO) {\n b = max += main.value;\n }\n // border也得计算在内\n if(isDirectionRow) {\n let w = borderRightWidth + borderLeftWidth;\n b += w;\n max += w;\n min += w;\n }\n else {\n let h = borderTopWidth + borderBottomWidth;\n b += h;\n max += h;\n min += h;\n }\n return { b, min, max };\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__marginAuto(this.currentStyle, data);\n this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n this.__width = fixedWidth ? w : x - data.x;\n this.__height = fixedHeight ? h : y - data.y;\n this.__cacheProps = {};\n }\n\n __preSet(renderMode, ctx, defs) {\n let { sx: x, sy: y, width, height, __cacheStyle, currentStyle, computedStyle } = this;\n let {\n borderTopWidth,\n borderLeftWidth,\n display,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n visibility,\n } = computedStyle;\n let originX = x + borderLeftWidth + marginLeft + paddingLeft;\n let originY = y + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n let iw = width + paddingLeft + paddingRight;\n let ih = height + paddingTop + paddingBottom;\n // 先根据cache计算需要重新计算的computedStyle\n ['stroke', 'fill'].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n if(v && (v.k === 'linear' || v.k === 'radial')) {\n __cacheStyle[k] = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, v);\n }\n else {\n __cacheStyle[k] = int2rgba(currentStyle[k]);\n }\n }\n });\n if(isNil(__cacheStyle.strokeWidth)) {\n __cacheStyle.strokeWidth = true;\n let strokeWidth = currentStyle.strokeWidth;\n if(strokeWidth.unit === PX) {\n computedStyle.strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n computedStyle.strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n computedStyle.strokeWidth = 0;\n }\n }\n if(isNil(__cacheStyle.strokeDasharray)) {\n __cacheStyle.strokeDasharray = true;\n computedStyle.strokeDasharray = currentStyle.strokeDasharray;\n __cacheStyle.strokeDasharrayStr = util.joinArr(currentStyle.strokeDasharray, ',');\n }\n // 直接赋值的\n [\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let {\n fill,\n stroke,\n strokeDasharrayStr,\n } = __cacheStyle;\n let {\n strokeWidth,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n strokeDasharray,\n fillRule,\n } = computedStyle;\n return {\n x,\n y,\n originX,\n originY,\n cx,\n cy,\n display,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n visibility,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS) {\n if(ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n if(ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(!util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n let cacheFilter = this.__cacheFilter, cacheTotal = this.__cacheTotal, cache = this.__cache;\n let virtualDom = this.virtualDom;\n // 存在老的缓存认为可提前跳出\n if(lv < level.REPAINT\n && (cacheTotal && cacheTotal.available || cache && cache.available || !level.contain(lv, level.FILTER) && cacheFilter)) {\n res.break = true; // geom子类标识可以跳过自定义render()\n }\n if(renderMode === mode.SVG) {\n // svg mock,每次都生成,每个节点都是局部根,更新时自底向上清除\n if(!cacheTotal) {\n this.__cacheTotal = {\n available: true,\n release() {\n this.available = false;\n delete virtualDom.cache;\n },\n };\n }\n else if(!cacheTotal.available) {\n cacheTotal.available = true;\n }\n this.virtualDom.type = 'geom';\n }\n // 无论canvas/svg,break可提前跳出省略计算\n if(res.break) {\n return res;\n }\n this.__cacheFilter = null;\n // data在无cache时没有提前设置\n let preData = (this.root.cache && renderMode === mode.CANVAS) ? this.__preData : this.__preSet(renderMode, ctx, defs);\n let { x2, y2 } = res;\n let { originX, originY } = preData;\n // 有cache时需计算差值\n let { paddingLeft, paddingTop } = this.computedStyle;\n x2 += paddingLeft;\n y2 += paddingTop;\n preData.dx = x2 - originX;\n preData.dy = y2 - originY;\n this.__preSetCanvas(renderMode, ctx, preData);\n return Object.assign(res, preData);\n }\n\n __renderAsMask(renderMode, lv, ctx, defs, isClip) {\n if(renderMode === mode.CANVAS) {\n this.root.cache && (this.__preData = this.__preSet(renderMode, ctx, defs));\n }\n // mask渲染在canvas等被遮罩层调用,svg生成maskId\n else if(renderMode === mode.SVG) {\n this.render(renderMode, lv, ctx, defs);\n let vd = this.virtualDom;\n if(isClip) {\n vd.isClip = true;\n }\n else {\n vd.isMask = true;\n }\n // 强制不缓存,防止引用mask的matrix变化不生效\n delete vd.lv;\n }\n }\n\n // 类似dom,但geom没有children所以没有total的概念\n __applyCache(renderMode, lv, ctx, mode, cacheTop, opacity, matrix) {\n let cacheFilter = this.__cacheFilter;\n let cacheMask = this.__cacheMask;\n let cache = this.__cache;\n let computedStyle = this.computedStyle;\n // 优先filter,然后mask,再cache\n let target = cacheFilter || cacheMask;\n // 向总的离屏canvas绘制,最后由top汇总再绘入主画布\n if(mode === refreshMode.CHILD) {\n let { sx: x, sy: y } = this;\n x += computedStyle.marginLeft;\n y += computedStyle.marginTop;\n let { coords: [tx, ty], x1, y1, dbx, dby } = cacheTop;\n let dx = tx + x - x1 + dbx;\n let dy = ty + y - y1 + dby;\n let tfo = computedStyle.transformOrigin.slice(0);\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n matrix = mx.multiply(matrix, m);\n ctx.setTransform(...matrix);\n opacity *= computedStyle.opacity;\n ctx.globalAlpha = opacity;\n if(target) {\n Cache.drawCache(target, cacheTop);\n }\n else if(cache && cache.available) {\n Cache.drawCache(cache, cacheTop);\n }\n }\n // root调用局部整体缓存或单个节点缓存绘入主画布\n else if(mode === refreshMode.ROOT) {\n let { __opacity, matrixEvent } = this;\n // 写回主画布前设置\n ctx.globalAlpha = __opacity;\n ctx.setTransform(...matrixEvent);\n if(target) {\n let { x1, y1, dbx, dby, canvas } = target;\n ctx.drawImage(canvas, x1 - 1 - dbx, y1 - 1 - dby);\n }\n else if(cache && cache.available) {\n let { coords: [tx, ty], x1, y1, dbx, dby, canvas, size } = cache;\n ctx.drawImage(canvas, tx - 1, ty - 1, size, size, x1 - 1 - dbx, y1 - 1 - dby, size, size);\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n __cancelCache(recursion) {\n super.__cancelCache(recursion);\n this.__cacheProps = {};\n }\n\n // geom强制有内容\n __calCache() {\n super.__calCache.apply(this, arguments);\n return true;\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n get baseLine() {\n return this.__height;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static getRegister(name) {\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return REGISTER.hasOwnProperty(name);\n }\n}\n\nexport default Geom;\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineGroup from './LineGroup';\nimport Component from './Component';\nimport Geom from '../geom/Geom';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport blur from '../style/blur';\nimport tf from '../style/transform';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport level from '../refresh/level';\nimport Cache from '../refresh/Cache';\nimport refreshMode from '../refresh/mode';\nimport mx from '../math/matrix';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nfunction genZIndexChildren(dom) {\n let flow = [];\n let abs = [];\n let needSort = false;\n let lastIndex;\n dom.children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 不是遮罩,并且已有computedStyle,特殊情况下中途插入的节点还未渲染\n if(!item.isMask && !item.isClip && item.computedStyle) {\n if(item instanceof Xom) {\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__iIndex = i;\n let z = child.__zIndex = item.currentStyle.zIndex;\n abs.push(child);\n if(lastIndex === undefined) {\n lastIndex = z;\n }\n else if(!needSort) {\n if(z < lastIndex) {\n needSort = true;\n }\n lastIndex = z;\n }\n }\n else {\n flow.push(child);\n }\n }\n else {\n flow.push(child);\n }\n }\n });\n needSort && abs.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n return a.__iIndex - b.__iIndex;\n });\n return flow.concat(abs);\n}\n\nfunction getMaskChildren(dom) {\n let list = [];\n dom.children.forEach(item => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item.isMask || item.isClip) {\n list.push(child);\n }\n });\n return list;\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(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style.fontWeight && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n }\n\n // 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Xom || item instanceof Component) {\n w -= item.__tryLayInline(w, total);\n }\n else {\n w -= item.textWidth;\n }\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n __calAutoBasis(isDirectionRow, w, h, isRecursion) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n marginLeft,\n marginTop,\n marginRight,\n marginBottom,\n paddingLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit === PX) {\n b = max = main.value;\n // 递归时children的长度会影响flex元素的最小宽度\n if(isRecursion) {\n min = b;\n }\n }\n // 递归children取最大值\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { b: b2, min: min2, max: max2 } = item.__calAutoBasis(isDirectionRow, w, h, true);\n b = Math.max(b, b2);\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n // 文本水平\n else if(isDirectionRow) {\n min = Math.max(item.charWidth, min);\n max = Math.max(item.textWidth, max);\n }\n // 文本垂直\n else {\n css.computeReflow(item);\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n // margin/padding/border也得计算在内,此时还没有,百分比相对于父flex元素的宽度\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth.value + borderRightWidth.value + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth.value + borderBottomWidth.value + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return { b, min, max };\n }\n\n // 换算margin/padding为px单位\n __calMp(v, w) {\n let n = 0;\n if(v.unit === PX) {\n n += v.value;\n }\n else if(v.unit === PERCENT) {\n v.value *= w * 0.01;\n v.unit = PX;\n n += v.value;\n }\n return n;\n }\n\n // 本身block布局时计算好所有子元素的基本位置\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, lineGroups } = this;\n lineGroups.splice(0);\n let {\n textAlign,\n } = computedStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 递归布局,将inline的节点组成lineGroup一行\n let lineGroup = new LineGroup(x, y);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(item.currentStyle.display === 'inline') {\n // inline开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.outerWidth;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x, w);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.outerWidth;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.outerWidth;\n }\n }\n }\n else {\n // block/flex先处理之前可能的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n y += lineGroup.height + lineGroup.marginBottom;\n lineGroup = new LineGroup(data.x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n x = data.x;\n y += item.outerHeight;\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n }\n }\n // 文字和inline类似\n else {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.width;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.width;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.width;\n }\n }\n }\n });\n // 结束后处理可能遗留的最后的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n // flex/abs的虚拟前置布局,无需真正计算\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n else {\n maxW = Math.max(maxW, cw);\n }\n y += lineGroup.height;\n }\n this.__width = fixedWidth || !isVirtual ? w : maxW;\n this.__height = fixedHeight ? h : y - data.y;\n if(lineGroup.size) {\n y += lineGroup.marginBottom;\n }\n // text-align\n if(!isVirtual && ['center', 'right'].indexOf(textAlign) > -1) {\n lineGroups.forEach(lineGroup => {\n let diff = w - lineGroup.width;\n if(diff > 0) {\n lineGroup.horizonAlign(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n if(!isVirtual) {\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle } = this;\n let {\n flexDirection,\n justifyContent,\n alignItems,\n } = currentStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n let maxX = 0;\n let isDirectionRow = flexDirection === 'row';\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let minList = [];\n let growSum = 0;\n let shrinkSum = 0;\n let basisSum = 0;\n let maxSum = 0;\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n // abs虚拟布局计算时纵向也是看横向宽度\n let { b, min, max } = item.__calAutoBasis(isVirtual ? true : isDirectionRow, w, h);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { currentStyle, computedStyle } = item;\n let { flexGrow, flexShrink, flexBasis } = currentStyle;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n growSum += flexGrow;\n shrinkSum += flexShrink;\n // 根据basis不同,计算方式不同\n if(flexBasis.unit === AUTO) {\n basisList.push(max);\n basisSum += max;\n }\n else if(flexBasis.unit === PX) {\n computedStyle.flexBasis = b = flexBasis.value;\n basisList.push(b);\n basisSum += b;\n }\n else if(flexBasis.unit === PERCENT) {\n b = computedStyle.flexBasis = (isDirectionRow ? w : h) * flexBasis.value * 0.01;\n basisList.push(b);\n basisSum += b;\n }\n maxSum += max;\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n shrinkSum += 1;\n if(isDirectionRow) {\n basisList.push(item.textWidth);\n basisSum += item.textWidth;\n maxSum += item.textWidth;\n minList.push(item.charWidth);\n }\n else {\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n basisList.push(item.height);\n basisSum += item.height;\n maxSum += item.height;\n minList.push(item.height);\n }\n }\n });\n if(isVirtual) {\n this.__width = Math.min(maxX, w);\n return;\n }\n let maxCross = 0;\n // 判断是否超出,决定使用grow还是shrink\n let isOverflow = maxSum > (isDirectionRow ? w : h);\n flowChildren.forEach((item, i) => {\n let main;\n let shrink = shrinkList[i];\n let grow = growList[i];\n // 计算主轴长度\n if(isOverflow) {\n let overflow = basisSum - (isDirectionRow ? w : h);\n main = shrink ? (basisList[i] - overflow * shrink / shrinkSum) : basisList[i];\n }\n else {\n let free = (isDirectionRow ? w : h) - basisSum;\n main = grow ? (basisList[i] + free * grow / growSum) : basisList[i];\n }\n // 主轴长度的最小值不能小于元素的最小长度,比如横向时的字符宽度\n main = Math.max(main, minList[i]);\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n let {\n display,\n flexDirection,\n width,\n height,\n } = currentStyle;\n // flex的child如果是inline,变为block\n if(display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n if(isDirectionRow) {\n // 横向flex的child如果是竖向flex,高度自动的话要等同于父flex的高度\n if(display === 'flex' && flexDirection === 'column' && fixedHeight && height.unit === AUTO) {\n height.value = h;\n height.unit = PX;\n }\n item.__layout({\n x,\n y,\n w: main,\n h,\n });\n }\n else {\n // 竖向flex的child如果是横向flex,宽度自动的话要等同于父flex的宽度\n if(display === 'flex' && flexDirection === 'row' && width.unit === AUTO) {\n width.value = w;\n width.unit = PX;\n }\n item.__layout({\n x,\n y,\n w,\n h: main,\n });\n }\n // 重设因伸缩而导致的主轴长度\n if(isOverflow && shrink || !isOverflow && grow) {\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n if(isDirectionRow) {\n item.__width = main - marginLeft - marginRight - paddingLeft - paddingRight - borderLeftWidth - borderRightWidth;\n }\n else {\n item.__height = main - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n }\n else {\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? w - x + data.x : h - y + data.y;\n // 主轴侧轴对齐方式\n if(!isOverflow && growSum === 0 && diff > 0) {\n let len = flowChildren.length;\n if(justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n // 子元素侧轴伸展\n if(isDirectionRow) {\n // 父元素固定高度,子元素可能超过,侧轴最大长度取固定高度\n if(fixedHeight) {\n maxCross = h;\n }\n y += maxCross;\n }\n else {\n if(fixedWidth) {\n maxCross = w;\n }\n }\n // 侧轴对齐\n if(!isVirtual) {\n if(alignItems === 'stretch') {\n // 短侧轴的children伸张侧轴长度至相同,超过的不动,固定宽高的也不动\n flowChildren.forEach(item => {\n let { computedStyle, currentStyle: { alignSelf, width, height } } = 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(alignSelf === 'flex-start') {}\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n if(alignSelf === 'flex-start') {}\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(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 { currentStyle: { alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { height } } = item;\n let {\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n paddingTop,\n paddingBottom,\n } = computedStyle;\n if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n }\n else {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { width } } = item;\n let {\n borderRightWidth,\n borderLeftWidth,\n marginRight,\n marginLeft,\n paddingRight,\n paddingLeft,\n } = computedStyle;\n if(width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\n else {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n }\n });\n }\n else if(alignItems === 'flex-end') {\n flowChildren.forEach(item => {\n let { currentStyle: { alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { height } } = item;\n let {\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n paddingTop,\n paddingBottom,\n } = computedStyle;\n if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n }\n else {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { width } } = item;\n let {\n borderRightWidth,\n borderLeftWidth,\n marginRight,\n marginLeft,\n paddingRight,\n paddingLeft,\n } = computedStyle;\n if(width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\n else {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n }\n });\n }\n else {\n flowChildren.forEach(item => {\n let { currentStyle: { alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { height } } = item;\n let {\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n paddingTop,\n paddingBottom,\n } = computedStyle;\n if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n }\n else {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { width } } = item;\n let {\n borderRightWidth,\n borderLeftWidth,\n marginRight,\n marginLeft,\n paddingRight,\n paddingLeft,\n } = computedStyle;\n if(width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\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.currentStyle.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 /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, innerWidth, innerHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n display,\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingLeft,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target && target !== item) {\n return;\n }\n let { currentStyle, computedStyle } = item;\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, innerWidth);\n if(computedStyle.display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n let { left, top, right, bottom, width, height, display, flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left.unit !== AUTO) {\n fixedLeft = true;\n computedStyle.left = calAbsolute(currentStyle, 'left', left, innerWidth);\n }\n else {\n computedStyle.left = 'auto';\n }\n if(right.unit !== AUTO) {\n fixedRight = true;\n computedStyle.right = calAbsolute(currentStyle, 'right', right, innerWidth);\n }\n else {\n computedStyle.right = 'auto';\n }\n if(top.unit !== AUTO) {\n fixedTop = true;\n computedStyle.top = calAbsolute(currentStyle, 'top', top, innerHeight);\n }\n else {\n computedStyle.top = 'auto';\n }\n if(bottom.unit !== AUTO) {\n fixedBottom = true;\n computedStyle.bottom = calAbsolute(currentStyle, 'bottom', bottom, innerHeight);\n }\n else {\n computedStyle.bottom = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle.left;\n w2 = x + innerWidth - computedStyle.right - x2;\n }\n else if(fixedLeft && width.unit !== AUTO) {\n x2 = x + computedStyle.left;\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n else if(fixedRight && width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n x2 = x + innerWidth - computedStyle.right - w2;\n // 右对齐有尺寸时y值还需减去margin/border/padding的\n x2 -= computedStyle.marginLeft;\n x2 -= computedStyle.marginRight;\n x2 -= computedStyle.paddingLeft;\n x2 -= computedStyle.paddingRight;\n x2 -= currentStyle.borderLeftWidth.value;\n x2 -= currentStyle.borderRightWidth.value;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle.left;\n }\n else if(fixedRight) {\n x2 = x + innerWidth - computedStyle.right;\n onlyRight = true;\n }\n else {\n x2 = x + paddingLeft;\n if(width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle.top;\n h2 = y + innerHeight - computedStyle.bottom - y2;\n }\n else if(fixedTop && height.unit !== AUTO) {\n y2 = y + computedStyle.top;\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n else if(fixedBottom && height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n y2 = y + innerHeight - computedStyle.bottom - h2;\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle.marginTop;\n y2 -= computedStyle.marginBottom;\n y2 -= computedStyle.paddingTop;\n y2 -= computedStyle.paddingBottom;\n y2 -= currentStyle.borderTopWidth.value;\n y2 -= currentStyle.borderBottomWidth.value;\n }\n else if(fixedTop) {\n y2 = y + computedStyle.top;\n }\n else if(fixedBottom) {\n y2 = y + innerHeight - computedStyle.bottom;\n onlyBottom = true;\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y;\n let prev = item.prev;\n while(prev) {\n if(prev instanceof Text || prev.computedStyle.position !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(!prev) {\n y2 = y;\n }\n if(height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if(display === 'block' && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : innerWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : innerHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target && target !== item) {\n return;\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n }\n\n render(renderMode, lv, ctx, defs) {\n // 无论缓存与否,都需执行,因为有计算或svg,且super自身判断了缓存情况省略渲染\n let res = super.render(renderMode, lv, ctx, defs);\n res = res || {};\n let { offScreen, isDestroyed, displayNone } = res;\n // canvas检查filter,无缓存时的绘制\n if(offScreen && offScreen.target && offScreen.target.ctx) {\n ctx = offScreen.target.ctx;\n }\n // 降级,有offScreen但没离屏canvas/webgl功能,舍弃blur\n else {\n offScreen = null;\n }\n let { root, virtualDom, children,\n computedStyle: { position } } = this;\n // 不显示的为了diff也要根据type生成\n if(renderMode === mode.SVG) {\n virtualDom.type = 'dom';\n }\n // canvas在隐藏时返回空,svg则有内容\n if(isDestroyed || displayNone) {\n return res;\n }\n // filter特殊缓存\n let blurValue = this.__blurValue;\n // 有filter时改变除filter之外的变化直接返回\n if(renderMode === mode.CANVAS && blurValue && this.__cacheFilter\n && lv < level.REPAINT && !level.contain(lv, level.FILTER)) {\n return res;\n }\n this.__cacheFilter = null;\n // 先检查是否有缓存且刷新等级在REPAINT以下,直接跳过无需继续\n let cacheTotal = this.__cacheTotal;\n if(lv < level.REPAINT && cacheTotal && cacheTotal.available) {\n if(renderMode === mode.CANVAS && blurValue) {\n // blur变化更新,用新的bbox先偏移cacheTotal,再更新cacheFilter,保持尺寸和边距一致性\n if(level.contain(lv, level.FILTER)) {\n let bbox = this.__mergeBbox(null, true);\n let newCache = Cache.updateCache(cacheTotal, bbox);\n if(newCache) {\n this.__cacheTotal = newCache;\n this.__cacheFilter = Cache.genOffScreenBlur(cacheTotal, blurValue);\n }\n // 更新后超限,丢掉blur降级\n else {\n console.error('CacheTotal is oversize');\n this.__cacheTotal = null;\n this.__cacheFilter = null;\n }\n }\n }\n return res;\n }\n // 先渲染过滤mask,仅svg进入,canvas在下面自身做,记得只首次执行\n if(renderMode === mode.SVG && !this.__noChildMask) {\n let hasMask;\n children.forEach(item => {\n if(!(item instanceof Component) && (item.isMask || item.isClip)) {\n hasMask = true;\n item.__renderAsMask(renderMode, item.__refreshLevel, ctx, defs, !item.isMask);\n }\n });\n // 没mask标识以后无需重复遍历\n if(!hasMask) {\n this.__noChildMask = true;\n }\n }\n // 查找所有非文本children是否都可以放入此层整体缓存,比如有的超尺寸或离屏功能不可用或动画执行影响\n let canCacheChildren = true;\n let draw = !root.cache || renderMode === mode.SVG;\n // 按照zIndex排序绘制过滤mask,同时由于svg严格按照先后顺序渲染,没有z-index概念,需要排序将relative/absolute放后面\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n // cache时canvas模式需将mask/clip的geom照常绘制出来,且保证先于其它孩子绘制\n if(root.cache && renderMode === mode.CANVAS) {\n let maskChildren = this.__maskChildren = this.__maskChildren || getMaskChildren(this);\n if(maskChildren.length) {\n zIndexChildren = maskChildren.concat(zIndexChildren);\n }\n }\n zIndexChildren.forEach(item => {\n // canvas开启缓存text先不渲染,节点先绘制到自身cache上\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(draw) {\n if(renderMode === mode.CANVAS) {\n if(ctx.globalAlpha !== this.__opacity) {\n ctx.globalAlpha = this.__opacity;\n }\n ctx.setTransform(...this.matrixEvent);\n }\n item.__renderByMask(renderMode, null, ctx);\n }\n }\n else {\n let lv2 = item.__refreshLevel;\n // geom需特殊处理,避免自定义geom覆盖render()时感知离屏功能\n let blurValue;\n let newCtx = ctx;\n let isGeom = item instanceof Geom;\n // geom计算bbox需提前获得数据\n if(isGeom) {\n item.__preData = item.__preSet(renderMode, ctx, defs);\n }\n let ignoreGeom, offScreen2;\n if(renderMode === mode.CANVAS && isGeom) {\n let filter = item.currentStyle.filter;\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n blurValue = v;\n }\n });\n }\n // 提前判断申请geom的cache,有老的用老的,没有申请新的,改写render()的ctx避免自定义geom感知离屏功能\n if(root.cache) {\n let cacheFilter = item.__cacheFilter, cacheMask = item.__cacheMask, cache = item.__cache;\n if(cacheFilter && blurValue && lv < level.REPAINT && !level.contain(lv2, level.FILTER) || cacheMask) {\n ignoreGeom = true;\n }\n else {\n item.__cacheFilter = item.__cacheMask = null;\n let bbox = item.bbox;\n // filter优先使用mask,再是cache\n if(lv2 < level.REPAINT && cache && cache.available) {\n ignoreGeom = true;\n if(blurValue && level.contain(lv2, level.FILTER)) {\n if(cacheMask) {\n cacheMask = item.__cacheMask = Cache.updateCache(cacheMask, bbox);\n }\n cache = item.__cache = Cache.updateCache(cache, bbox);\n if(cacheMask || cache && cache.available) {\n item.__cacheFilter = Cache.genOffScreenBlur(cacheMask || cache, blurValue);\n }\n // 更新后超限,丢掉blur降级\n else {\n console.error('Geom cache is oversize');\n item.__cache = null;\n }\n }\n }\n else {\n if(cache) {\n if(cache.enabled) {\n if(lv2 < level.REPAINT) {\n if(level.contain(lv2, level.FILTER)) {\n cache.reset(bbox);\n }\n }\n else {\n cache.reset(bbox);\n }\n }\n else {\n cache.reset(bbox);\n }\n }\n else {\n cache = item.__cache = Cache.getInstance(bbox);\n }\n if(cache && cache.enabled) {\n newCtx = cache.ctx;\n }\n }\n }\n }\n else if(blurValue) {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$blur$$__');\n if(c.ctx) {\n offScreen2 = {\n ctx,\n };\n offScreen2.target = c;\n newCtx = c.ctx;\n }\n }\n }\n // 即便ignore也要render(),要计算matrix,xom里也会判断重复\n let temp = item.__renderByMask(renderMode, lv2, newCtx, defs);\n if(ignoreGeom) {\n temp = { canCache: true };\n }\n // geom特殊处理filter,分缓存和非缓存情况\n if(renderMode === mode.CANVAS && isGeom && !ignoreGeom) {\n let hasMC;\n let next = item.next;\n let hasMask = next && next.isMask;\n let hasClip = next && next.isClip;\n if(hasMask || hasClip) {\n hasMC = true;\n }\n let cacheMask = item.__cacheMask, cache = item.__cache;\n // 先尝试绘制mask,再看filter\n if(root.cache && hasMC && cache && cache.available) {\n let { transform, transformOrigin } = item.computedStyle;\n item.__cacheMask = Cache.drawMask(cache, next, transform, transformOrigin.slice(0));\n }\n if(root.cache && blurValue && (cacheMask || cache && cache.available)) {\n item.__cacheFilter = Cache.genOffScreenBlur(cacheMask || cache, blurValue);\n }\n else if(offScreen2) {\n let { width, height } = root;\n let webgl = inject.getCacheWebgl(width, height, '__$$blur$$__');\n let res = blur.gaussBlur(offScreen2.target, webgl, blurValue, width, height);\n offScreen2.ctx.drawImage(offScreen2.target.canvas, 0, 0);\n offScreen2.target.draw();\n res.clear();\n }\n }\n // Xom类型canvas无有效动画时方可被父亲缓存,svg用不到\n if(!canCacheChildren || !temp || !temp.canCache || item.availableAnimating) {\n canCacheChildren = false;\n }\n }\n });\n /**\n * canvas决定是否作为一个局部整体是否缓存的因素\n * 首先本身无有影响的动画,且children无有效的动画\n * 然后本身是relative/absolute/Component\n * root作为最后执行,即便不满足条件也要特殊处理,重复递归应用缓存\n * 目前处于递归的回溯阶段,即冒泡阶段,\n * 所有局部根节点进行绘制局部整体缓存,待root再次递归执行一次\n * filter是个特殊情况,需要webgl离屏执行,所以一定有缓存\n * 有mask也是个特殊情况,一定需要total\n * svg则不需要这些,vd上cache标明整体缓存无需递归diff\n */\n let canCacheSelf = renderMode === mode.CANVAS\n && (canCacheChildren && !this.effectiveAnimating || blurValue);\n if(canCacheSelf && !blurValue && ['relative', 'absolute'].indexOf(position) === -1 && !this.isShadowRoot) {\n canCacheSelf = false;\n }\n let hasMC;\n if(renderMode === mode.CANVAS) {\n let next = this.next;\n let hasMask = next && next.isMask;\n let hasClip = next && next.isClip;\n if(hasMask || hasClip) {\n hasMC = true;\n canCacheSelf = true;\n }\n }\n // 需考虑缓存和滤镜\n if(renderMode === mode.CANVAS) {\n // 冒泡阶段将所有局部整体缓存离屏绘制好以便调用\n if(root.cache) {\n // root最终执行,递归所有children应用自身缓存,遇到局部根节点离屏缓存则绘制到主屏上\n if(this === root) {\n this.__applyCache(renderMode, lv, ctx, refreshMode.ROOT);\n }\n // 作为局部根节点整体进行绘制并缓存,递归将所有子节点绘制到局部整体上,img除外自己处理\n else if(canCacheSelf && this.tagName.toLowerCase() !== 'img') {\n this.__applyCache(renderMode, lv, ctx, refreshMode.TOP);\n if(hasMC) {\n let cacheTotal = this.__cacheTotal;\n if(cacheTotal && cacheTotal.available) {\n let { transform, transformOrigin } = this.computedStyle;\n let next = this.next;\n this.__cacheMask = Cache.drawMask(cacheTotal, next, transform, transformOrigin.slice(0));\n }\n // 极端情况超限异常\n else {\n console.error('CacheTotal is oversize with mask');\n }\n }\n }\n // 非局部缓存的节点等待root调用\n }\n // 无缓存时有offScreen对象,尝试使用webgl的blur,对象生成条件在Xom初始化做\n else if(offScreen) {\n let { width, height } = root;\n let webgl = inject.getCacheWebgl(width, height, '__$$blur$$__');\n let res = blur.gaussBlur(offScreen.target, webgl, offScreen.blur, width, height);\n offScreen.ctx.drawImage(offScreen.target.canvas, 0, 0);\n offScreen.target.draw();\n res.clear();\n }\n }\n else if(renderMode === mode.SVG) {\n // svg mock,每次都生成,每个节点都是局部根,更新时自底向上清除\n if(!cacheTotal) {\n this.__cacheTotal = {\n available: true,\n release() {\n this.available = false;\n delete virtualDom.cache;\n },\n };\n }\n else if(!cacheTotal.available) {\n cacheTotal.available = true;\n }\n // img的children在子类特殊处理\n if(this.tagName.toLowerCase() !== 'img') {\n virtualDom.children = zIndexChildren.map(item => item.virtualDom);\n }\n // 没变化则将text孩子设置cache\n if(virtualDom.hasOwnProperty('lv')) {\n this.virtualDom.children.forEach(item => {\n if(item.type === 'text') {\n item.cache = true;\n }\n });\n }\n else {\n this.virtualDom.children.forEach(item => {\n if(item.type === 'text') {\n delete item.cache;\n }\n });\n }\n }\n // 向上回溯传值,要考虑children\n if(res.canCache && !canCacheChildren) {\n res.canCache = false;\n }\n res.canCacheSelf = canCacheSelf;\n res.hasMC = hasMC;\n return res;\n }\n\n /**\n * canvas下,应用离屏内容缓存到主屏或者局部根节点上\n * 有可能子节点没超限但整体超限,此时要考虑降级分别绘制\n * @param renderMode\n * @param lv\n * @param ctx\n * @param mode 局部根节点总缓存、及其子节点、最后root发起的无局部整体的节点自身缓存应用\n * @param cacheTop 汇总离屏canvas的目标\n * @param opacity 以top为基点\n * @param matrix 以top为基点\n */\n __applyCache(renderMode, lv, ctx, mode, cacheTop, opacity, matrix) {\n let {\n computedStyle,\n __blurValue: blurValue,\n __cacheMask: cacheMask,\n __cacheFilter: cacheFilter,\n __cacheTotal: cacheTotal,\n __cache: cache,\n zIndexChildren,\n } = this;\n let { display, visibility } = computedStyle;\n if(display === 'none') {\n return;\n }\n // 局部根节点缓存汇总渲染\n if(mode === refreshMode.TOP) {\n if(visibility === 'hidden') {\n return;\n }\n let bboxTotal = this.__mergeBbox(null, true);\n // 空内容\n if(!bboxTotal) {\n return;\n }\n // 第一次初始化进行bbox合集计算\n if(!cacheTotal) {\n cacheTotal = this.__cacheTotal = Cache.getInstance(bboxTotal);\n }\n // 后续如果超过可缓存的lv重设,否则直接用已有内容,重复利用在render()里做了,这里reset\n else if(!cacheTotal.enabled) {\n cacheTotal.reset(bboxTotal);\n }\n let { sx, sy } = this;\n let x1 = sx + computedStyle.marginLeft;\n let y1 = sy + computedStyle.marginTop;\n // 缓存可用时各children依次执行进行离屏汇总\n if(cacheTotal && cacheTotal.enabled) {\n cacheTotal.__bbox = bboxTotal;\n cacheTotal.__appendData(x1, y1);\n // 每次刷新重新生成,一般都会进,特殊情况下遗留的老cacheTotal可以直接用\n if(!cacheTotal.available) {\n cacheTotal.__available = true;\n ctx = cacheTotal.ctx;\n // 以top为基准matrix/opacity\n if(ctx.globalAlpha !== 1) {\n ctx.globalAlpha = 1;\n }\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(cache && cache.available) {\n Cache.drawCache(cache, cacheTotal);\n }\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(ctx.globalAlpha !== 1) {\n ctx.globalAlpha = 1;\n }\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n item.__renderByMask(renderMode, null, ctx, null, cacheTotal.dx, cacheTotal.dy);\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, refreshMode.CHILD, cacheTotal, 1, [1, 0, 0, 1, 0, 0]);\n }\n });\n }\n }\n // 超尺寸无法进行,降级渲染\n else {\n let tx = sx + computedStyle.marginLeft;\n let ty = sy + computedStyle.marginTop;\n super.__applyCache(renderMode, ctx, tx - 1, ty - 1);\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n item.__renderByMask(renderMode, null, ctx);\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, refreshMode.ROOT);\n }\n });\n }\n // 生成filter缓存,超尺寸降级舍弃\n if(blurValue && cacheTotal && cacheTotal.available) {\n this.__cacheFilter = Cache.genOffScreenBlur(cacheTotal, blurValue);\n }\n else if(cacheFilter) {\n console.error('CacheFilter is oversize');\n this.__cacheFilter = null;\n }\n }\n // 向总的离屏canvas绘制,最后由top汇总再绘入主画布\n else if(mode === refreshMode.CHILD) {\n let { coords: [tx, ty], x1, y1, dbx, dby } = cacheTop;\n let { sx, sy } = this;\n sx += computedStyle.marginLeft;\n sy += computedStyle.marginTop;\n let dx = tx + sx - x1 + dbx;\n let dy = ty + sy - y1 + dby;\n if(visibility !== 'hidden') {\n let tfo = computedStyle.transformOrigin.slice(0);\n opacity *= computedStyle.opacity;\n if(ctx.globalAlpha !== opacity) {\n ctx.globalAlpha = opacity;\n }\n // 优先filter/mask,再是total\n if(cacheFilter || cacheMask || cacheTotal && cacheTotal.available) {\n let target = cacheFilter || cacheMask || cacheTotal;\n Cache.drawCache(target, cacheTop, computedStyle.transform, matrix, tfo);\n return;\n }\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n matrix = mx.multiply(matrix, m);\n ctx.setTransform(...matrix);\n // 都没有正常cache和children\n if(cache && cache.available) {\n Cache.drawCache(cache, cacheTop);\n }\n }\n // 递归children\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(visibility !== 'hidden') {\n if(ctx.globalAlpha !== opacity) {\n ctx.globalAlpha = opacity;\n }\n ctx.setTransform(...matrix);\n item.__renderByMask(renderMode, null, ctx, null, dx - item.sx + computedStyle.paddingLeft, dy - item.sy + computedStyle.paddingTop);\n }\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, mode, cacheTop, opacity, matrix);\n }\n });\n }\n // root调用局部整体缓存或单个节点缓存绘入主画布\n else if(mode === refreshMode.ROOT) {\n let { __opacity, matrixEvent } = this;\n if(visibility !== 'hidden') {\n // 写回主画布前设置\n if(ctx.globalAlpha !== __opacity) {\n ctx.globalAlpha = __opacity;\n }\n ctx.setTransform(...matrixEvent);\n let target = cacheFilter || cacheMask;\n if(target) {\n let { x1, y1, dbx, dby, canvas } = target;\n ctx.drawImage(canvas, x1 - 1 - dbx, y1 - 1 - dby);\n return;\n }\n if(cacheTotal && cacheTotal.available) {\n let { coords: [x, y], canvas, x1, y1, dbx, dby, width, height } = cacheTotal;\n ctx.drawImage(canvas, x - 1, y - 1, width, height, x1 - 1 - dbx, y1 - 1 - dby, width, height);\n return;\n }\n // 无内容就没有cache,继续看children\n if(cache && cache.available) {\n let { coords: [x, y], canvas, x1, y1, dbx, dby, width, height } = cache;\n ctx.drawImage(canvas, x - 1, y - 1, width, height, x1 - 1 - dbx, y1 - 1 - dby, width, height);\n }\n }\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(visibility !== 'hidden') {\n if(ctx.globalAlpha !== __opacity) {\n ctx.globalAlpha = __opacity;\n }\n ctx.setTransform(...matrixEvent);\n item.__renderByMask(renderMode, null, ctx);\n }\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, mode);\n }\n });\n }\n }\n\n /**\n * 以cacheTotal为基准递归合并包含children的bbox\n * @param matrix\n * @param isTop\n * @param tx 顶dom的坐标\n * @param ty\n * @param dx filter造成的偏移,递归传递下去所有children需要扩展此值\n * @param dy\n * @returns bbox\n * @private\n */\n __mergeBbox(matrix, isTop, tx, ty, dx, dy) {\n let bbox;\n let { sx, sy, computedStyle } = this;\n let display = computedStyle.display;\n // 顶点初始化为起点,偏移值要考虑filter\n if(isTop) {\n matrix = [1, 0, 0, 1, 0, 0];\n bbox = super.__mergeBbox(matrix, isTop);\n tx = sx;\n ty = sy;\n if(bbox) {\n dx = sx + computedStyle.marginLeft - bbox[0];\n dy = sy + computedStyle.marginTop - bbox[1];\n }\n else if(Array.isArray(computedStyle.filter)) {\n computedStyle.filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let d = mx.int2convolution(v);\n dx = dy = d;\n }\n });\n }\n else {\n dx = dy = 0;\n }\n }\n else if(display !== 'none') {\n let tfo = computedStyle.transformOrigin.slice(0);\n tfo[0] += sx - tx;\n tfo[1] += sy - ty;\n let m = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n matrix = mx.multiply(matrix, m);\n bbox = super.__mergeBbox(matrix, isTop, dx, dy);\n }\n if(display !== 'none') {\n this.zIndexChildren.forEach(item => {\n let t = item.__mergeBbox(matrix, false, tx, ty, dx, dy);\n if(!bbox) {\n bbox = t;\n }\n // display:none可能为空\n else if(t) {\n bbox[0] = Math.min(bbox[0], t[0]);\n bbox[1] = Math.min(bbox[1], t[1]);\n bbox[2] = Math.max(bbox[2], t[2]);\n bbox[3] = Math.max(bbox[3], t[3]);\n }\n });\n }\n return bbox;\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param isHost\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, isHost, cb) {\n super.__computeMeasure(renderMode, ctx, isHost, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, false, cb);\n });\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n this.children.splice(0);\n this.lineGroups.splice(0);\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n }\n // child不触发再看自己\n return super.__emitEvent(e);\n }\n\n __cancelCache(recursion) {\n super.__cancelCache(recursion);\n if(recursion) {\n this.children.forEach(child => {\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n child.__cancelCache(recursion);\n }\n });\n }\n }\n\n // 深度遍历执行所有子节点,包含自己,如果cb返回true,提前跳出不继续深度遍历\n deepScan(cb, options) {\n if(super.deepScan(cb, options)) {\n return;\n }\n this.children.forEach(node => {\n node.deepScan(cb, options);\n });\n }\n\n get children() {\n return this.__children;\n }\n\n get flowChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Text || item.currentStyle.position !== 'absolute';\n });\n }\n\n get absChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Xom && item.currentStyle.position === 'absolute';\n });\n }\n\n get zIndexChildren() {\n return this.__zIndexChildren || [];\n }\n\n get lineGroups() {\n return this.__lineGroups;\n }\n\n get baseLine() {\n let len = this.lineGroups.length;\n if(len) {\n let last = this.lineGroups[len - 1];\n return last.y - this.y + last.baseLine;\n }\n return this.y;\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport transform from '../style/transform';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\nimport refreshMode from '../refresh/mode';\nimport Cache from '../refresh/Cache';\n\nconst { AUTO } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {};\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = this.props.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.url = src;\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, 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 virtualDom,\n __cache,\n } = this;\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return res;\n }\n let originX, originY;\n // img无children所以total就是cache避免多余生成\n if(renderMode === mode.CANVAS) {\n this.__cacheTotal = __cache;\n }\n if(__cache && __cache.enabled) {\n ctx = __cache.ctx;\n originX = res.x2 + paddingLeft;\n originY = res.y2 + paddingTop;\n }\n else {\n originX = x + marginLeft + borderLeftWidth + paddingLeft;\n originY = y + marginTop + borderTopWidth + paddingTop;\n }\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 // virtualDom.children = [];\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(loadImg.url === src) {\n let source = loadImg.source;\n // 无source不绘制\n if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n props.push(['transform', 'matrix(' + util.joinArr(matrix, ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n }\n else {\n let loadImg = this.__loadImg;\n loadImg.url = src;\n loadImg.source = null;\n loadImg.error = null;\n loadImg.cache = false;\n inject.measureImg(src, data => {\n let self = this;\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.url && !self.__isDestroyed) {\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else {\n loadImg.error = true;\n }\n let { root, currentStyle: { width, height } } = self;\n root.delRefreshTask(self.__task);\n if(width.unit !== AUTO && height.unit !== AUTO) {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REPAINT,\n img: true,\n });\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行\n img: true, // 特殊标识强制布局即便没有style变化\n });\n },\n });\n }\n }\n }, {\n width,\n height,\n });\n }\n if(res.canCacheSelf) {\n this.__applyCache(renderMode, lv, ctx, refreshMode.TOP);\n if(res.hasMC) {\n let cacheTotal = this.__cacheTotal;\n if(cacheTotal && cacheTotal.available) {\n let { transform, transformOrigin } = this.computedStyle;\n let next = this.next;\n this.__cacheMask = Cache.drawMask(cacheTotal, next, transform, transformOrigin.slice(0));\n }\n // 极端情况超限异常\n else {\n console.error('CacheTotal is oversize with img\\'s mask');\n }\n }\n }\n return res;\n }\n\n get baseLine() {\n return this.height;\n }\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n }\n add(data) {\n data.uuid = 'karas-defs-' + this.id + '-' + this.count++;\n this.list.push(data);\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import util from './util';\nimport builder from './builder';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n}\n\n/**\n * 检查cp是否有state变更\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n check(cp.shadowRoot);\n }\n }\n else {\n check(cp.shadowRoot);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.__state = state;\n cp.__nextState = null;\n let oldS = cp.shadow;\n let oldJson = cp.__cd;\n let json = builder.flattenJson(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let s = cp.shadow;\n if(s instanceof Xom) {\n s.__width = oldS.width;\n s.__height = oldS.height;\n s.__computedStyle = oldS.computedStyle;\n s.__layoutData = oldS.layoutData;\n }\n else {\n s.__parent = oldS.parent;\n }\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.placeholder) {\n delete json.placeholder;\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.inherit = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建\n // 否则需要强制触发组件更新,包含setState内容\n nj.placeholder = true;\n nj.value = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n console.error('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList = [];\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n updateList,\n check,\n checkCp,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\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 // = 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, visibility, mask, clip, filter, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(ovd.clip) {\n elem.removeAttribute('clip-path');\n }\n }\n if(ovd.clip !== clip) {\n if(clip) {\n elem.setAttribute('clip-path', clip);\n }\n else {\n elem.removeAttribute('clip-path');\n }\n if(ovd.mask) {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter) {\n if(filter) {\n elem.setAttribute('filter', filter);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n if(lv === level.NONE) {\n return;\n }\n let { transform, opacity, visibility, mask, clip, filter } = nvd;\n if(level.contain(lv, level.TRANSLATE_X | level.TRANSLATE_Y | level.TRANSFORM)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(level.contain(lv, level.OPACITY)) {\n if(opacity !== 1) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(level.contain(lv, level.VISIBILITY)) {\n elem.setAttribute('visibility', visibility);\n }\n if(level.contain(lv, level.FILTER)) {\n if(filter) {\n elem.setAttribute('filter', filter);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(ovd.clip) {\n elem.removeAttribute('clip-path');\n }\n if(clip) {\n elem.setAttribute('clip-path', clip);\n }\n else {\n elem.removeAttribute('clip-path');\n }\n if(ovd.mask) {\n elem.removeAttribute('mask');\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(lastChild, i, ovd.children[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb, oClip, nClip) {\n let ol = obb.length;\n let nl = nbb.length;\n if(oClip !== nClip) {\n if(!nClip) {\n elem.removeAttribute('clip-path');\n }\n else {\n elem.setAttribute('clip-path', nClip);\n }\n }\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n add(v) {\n if(this.__list.indexOf(v) === -1) {\n this.list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(list = this.__records) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(list.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n list.splice(0).forEach(item => {\n let { target, animate } = item;\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n }\n });\n }\n }\n\n __playAuto() {\n this.init(this.__auto);\n this.__action('play');\n }\n\n play(cb) {\n this.init();\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n cancel(cb) {\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n get list() {\n return this.__list;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Component from './Component';\nimport Defs from './Defs';\nimport mode from './mode';\nimport Geom from '../geom/Geom';\nimport builder from '../util/builder';\nimport updater from '../util/updater';\nimport util from '../util/util';\nimport diff from '../util/diff';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport Controller from '../animate/Controller';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\n\nconst { isNil, isObject, isFunction } = util;\nconst { AUTO, PX, PERCENT } = unit;\nconst { calRelative, isRelativeOrAbsolute } = css;\n\nfunction getDom(dom) {\n if(util.isString(dom) && dom) {\n let o = document.querySelector(dom);\n if(!o) {\n throw new Error('Can not find dom of selector: ' + dom);\n }\n return o;\n }\n if(!dom) {\n throw new Error('Can not find dom: ' + dom);\n }\n return dom;\n}\n\nfunction renderProp(k, v) {\n let s = Array.isArray(v) ? util.joinSourceArray(v) : util.stringify(v);\n if(k === 'className') {\n k = 'class';\n }\n return ' ' + k + '=\"' + util.encodeHtml(s, true) + '\"';\n}\n\nfunction initEvent(dom) {\n ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(type => {\n dom.addEventListener(type, e => {\n let root = dom.__root;\n if(['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1) {\n root.__touchstartTarget && root.__touchstartTarget.__emitEvent(root.__wrapEvent(e), true);\n }\n else {\n root.__cb(e);\n }\n });\n });\n}\n\n// 提取出对比节点尺寸是否修改,用currentStyle的对比computedStyle的\nfunction isFixedWidthOrHeight(node, root, k) {\n let c = node.currentStyle[k];\n let v = node.computedStyle[k];\n if(c.unit === PX) {\n return c.value === v;\n }\n if(c.unit === PERCENT) {\n let parent = node.domParent;\n let s = parent.layoutData[k === 'width' ? 'w' : 'h'];\n return c.value * s * 0.01 === v;\n }\n return false;\n}\nfunction isFixedSize(node, root) {\n return isFixedWidthOrHeight(node, root, 'width') && isFixedWidthOrHeight(node, root, 'height');\n}\n\nconst OFFSET = 0;\nconst LAYOUT = 1;\nfunction isLAYOUT(node, hash) {\n return node.hasOwnProperty('__uniqueReflowId') && hash[node.__uniqueReflowId] >= LAYOUT;\n}\n\nfunction setLAYOUT(node, hash) {\n addLAYOUT(node, hash);\n hash[node.__uniqueReflowId].lv |= LAYOUT;\n}\n\nlet __uniqueReflowId = 0;\nfunction addLAYOUT(node, hash) {\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n hash[__uniqueReflowId++] = {\n node,\n lv: LAYOUT,\n };\n }\n}\n\nlet uniqueUpdateId = 0;\nfunction parseUpdate(renderMode, root, updateHash, target, reflowList, measureList, cacheHash, cacheList) {\n let { node, style, origin, overwrite, focus, img, measure, list } = target;\n // updateStyle()这样的调用还要计算normalize\n if(origin && style) {\n style = css.normalize(style);\n }\n // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复\n if(overwrite && style) {\n Object.assign(node.__style, style);\n }\n if(style && style !== target.style) {\n Object.assign(target.style, style);\n }\n // 多次调用更新才会有list,一般没有,优化\n if(list) {\n list.forEach(item => {\n let { style, origin, overwrite } = item;\n if(origin && style) {\n style = css.normalize(style);\n }\n if(overwrite && style) {\n Object.assign(node.__style, style);\n }\n if(style) {\n Object.assign(target.style, style);\n }\n });\n }\n style = target.style;\n // 按节点合并完style后判断改变等级\n let { tagName, currentStyle, currentProps, __cacheStyle = {}, __cacheProps = {} } = node;\n let lv = level.NONE;\n let p;\n let hasMeasure = measure;\n let hasZ;\n for(let k in style) {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n // 只有geom的props和style2种可能\n if(change.isGeom(tagName, k)) {\n if(!css.equalStyle(k, v, currentProps[k], node)) {\n p = p || {};\n p[k] = style[k];\n lv |= level.REPAINT;\n __cacheProps[k] = undefined;\n }\n }\n else {\n // 需和现在不等,且不是pointerEvents这种无关的\n if(!css.equalStyle(k, v, currentStyle[k], node)) {\n // pointerEvents这种无关的只需更新\n if(change.isIgnore(k)) {\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n else {\n // TRBL变化只对relative/absolute起作用,其它忽视\n if({ top: true, right: true, bottom: true, left:true }.hasOwnProperty(k)) {\n if(currentStyle.position !== 'relative' && currentStyle.position !== 'absolute'\n && style.position !== 'relative' && style.position !== 'absolute') {\n delete style[k];\n continue;\n }\n }\n // 只粗略区分出none/repaint/reflow,repaint细化等级在后续,reflow在checkReflow()\n lv |= level.getLevel(k);\n if(change.isMeasure(k)) {\n hasMeasure = true;\n }\n // repaint置空,如果reflow会重新生成空的\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n if(k === 'zIndex') {\n hasZ = true;\n }\n }\n }\n }\n }\n if(p) {\n Object.assign(currentProps, p);\n }\n if(style) {\n Object.assign(currentStyle, style);\n }\n if(!isNil(focus)) {\n lv |= focus;\n }\n // 无任何改变处理的去除记录,如pointerEvents、无效的left\n if(lv === level.NONE && !img) {\n delete node.__uniqueUpdateId;\n return;\n }\n // 记录下来清除parent的zIndexChildren缓存\n if(hasZ) {\n delete node.domParent.__zIndexChildren;\n }\n // reflow/repaint/measure相关的记录下来\n let isRepaint = level.isRepaint(lv);\n if(isRepaint) {\n // zIndex变化需清空svg缓存\n if(hasZ && renderMode === mode.SVG) {\n lv |= level.REPAINT;\n }\n if(!isNil(focus)) {\n lv |= focus;\n }\n }\n // reflow在root的refresh中做\n else {\n reflowList.push({\n node,\n style,\n img,\n });\n // measure需要提前先处理\n if(hasMeasure) {\n measureList.push(node);\n }\n }\n node.__refreshLevel = lv;\n // dom在>=REPAINT时total失效,svg的geom比较特殊,任何改变都失效\n let need = node.__refreshLevel >= level.REPAINT || renderMode === mode.SVG && node instanceof Geom;\n if(need) {\n if(node.__cache) {\n node.__cache.release();\n }\n if(node.__cacheTotal) {\n node.__cacheTotal.release();\n }\n if(node.__cacheMask) {\n node.__cacheMask = null;\n }\n }\n if((need || level.contain(lv, level.FILTER)) && node.__cacheFilter) {\n node.__cacheFilter = null;\n }\n // 向上清除等级>=REPAINT的汇总缓存信息,过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n let parent = node.domParent;\n // 向上查找,出现重复跳出\n while(parent) {\n if(parent.hasOwnProperty('__uniqueUpdateId')) {\n let id = parent.__uniqueUpdateId;\n if(cacheHash.hasOwnProperty(id)) {\n break;\n }\n cacheHash[id] = true;\n }\n // 没有的需要设置一个标识\n else {\n let id = parent.__uniqueUpdateId = uniqueUpdateId++;\n cacheHash[id] = true;\n cacheList.push(parent);\n }\n let lv = parent.__refreshLevel;\n let need = lv >= level.REPAINT;\n if(need && parent.__cache) {\n parent.__cache.release();\n }\n // 前面已经过滤了无改变NONE的,只要孩子有任何改变父亲就要清除\n if(parent.__cacheTotal) {\n parent.__cacheTotal.release();\n }\n if(parent.__cacheFilter) {\n parent.__cacheFilter = null;\n }\n if(parent.__cacheMask) {\n parent.__cacheMask = null;\n }\n parent = parent.domParent;\n }\n return true;\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__cd = children || []; // 原始children,再初始化过程中生成真正的dom\n this.__dom = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n this.__scx = 1; // 默认缩放,css改变canvas/svg缩放后影响事件坐标\n this.__scy = 1;\n this.__task = [];\n this.__ref = {};\n this.__updateList = [];\n this.__updateHash = {};\n this.__reflowList = [{ node: this }]; // 初始化填自己,第一次布局时复用逻辑完全重新布局\n this.__animateController = new Controller();\n Event.mix(this);\n }\n\n __initProps() {\n let w = this.props.width;\n if(!isNil(w)) {\n let value = parseFloat(w) || 0;\n if(value > 0) {\n this.__width = value;\n }\n }\n let h = this.props.height;\n if(!isNil(h)) {\n let value = parseFloat(h) || 0;\n if(value > 0) {\n this.__height = value;\n }\n }\n }\n\n __genHtml() {\n let res = `<${this.tagName}`;\n // 拼接处理属性\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n });\n res += `>`;\n return res;\n }\n\n __wrapEvent(e) {\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { dom, __scx, __scy } = this;\n let { x: x2, y: y2, left, top } = dom.getBoundingClientRect();\n x = x2 || left || 0;\n y = y2 || top || 0;\n let { pageX, pageY } = e.touches ? e.touches[0] : e;\n x = pageX - x;\n y = pageY - y;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标\n if(__scx !== 1) {\n x /= __scx;\n }\n if(__scy !== 1) {\n y /= __scy;\n }\n }\n return {\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n e.stopPropagation();\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n e.stopImmediatePropagation();\n },\n preventDefault() {\n e.preventDefault();\n },\n x,\n y,\n __hasEmitted: false,\n };\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接响应\n __cb(e) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let data = this.__wrapEvent(e);\n this.__emitEvent(data);\n return data;\n }\n\n appendTo(dom) {\n dom = getDom(dom);\n this.__children = builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n this.cache = !!this.props.cache;\n // 已有root节点\n if(dom.nodeName.toUpperCase() === this.tagName.toUpperCase()) {\n this.__dom = dom;\n if(this.width) {\n dom.setAttribute('width', this.width);\n }\n if(this.height) {\n dom.setAttribute('height', this.height);\n }\n }\n // 没有canvas/svg节点则生成一个新的\n else {\n this.__dom = dom.querySelector(this.tagName);\n if(!this.__dom) {\n dom.innerHTML = this.__genHtml();\n this.__dom = dom.querySelector(this.tagName);\n }\n }\n this.__uuid = isNil(this.__dom.__uuid) ? uuid++ : this.__dom.__uuid;\n this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid);\n // 没有设置width/height则采用css计算形式\n if(!this.width || !this.height) {\n let css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root) {\n this.dom.__root.destroy();\n }\n else {\n initEvent(this.dom);\n this.dom.__uuid = this.__uuid;\n }\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,一般是同步,为了防止外部因素inject是异步写成了cb形式\n inject.measureText(() => {\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS) {\n this.__clear(ctx);\n }\n this.render(renderMode, this.__refreshLevel, ctx, defs);\n if(renderMode === mode.SVG) {\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__root) {\n diff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH);\n });\n }\n\n destroy() {\n this.__destroy();\n frame.offFrame(this.__rTask);\n let n = this.dom;\n if(n) {\n n.__root = null;\n }\n }\n\n scale(x = 1, y = x) {\n this.__scx = x;\n this.__scy = y;\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 let setStateList = [];\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.before)) {\n // 收集组件setState的更新,特殊处理\n if(item.__state) {\n setStateList.push(i);\n }\n item.before(diff);\n }\n });\n // 刷新前先进行setState检查,全都是setState触发的且没有更新则无需刷新\n if(setStateList.length) {\n updater.check(this);\n }\n // 有组件更新,则需要重新布局\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let sr = cp.shadowRoot;\n // 可能返回text,需视为其parentNode\n if(sr instanceof Text) {\n sr = sr.domParent;\n }\n this.__addUpdate({\n node: sr,\n style: sr.currentStyle,\n focus: level.REFLOW,\n measure: true, // 未知强制measure\n });\n });\n this.refresh();\n }\n // 有可能组件都不需要更新,且没有其它触发的渲染更新\n else if(clone.length > setStateList.length) {\n this.refresh();\n }\n // 避免重复刷新,在frame每帧执行中,比如图片进行了异步刷新,动画的hook就可以省略再刷新一次\n let r = this.__hookTask;\n if(r) {\n let hookTask = frame.__hookTask;\n let i = hookTask.indexOf(r);\n if(i > -1) {\n hookTask.splice(i, 1);\n }\n }\n // 触发didUpdate\n updater.did();\n }\n },\n after: diff => {\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n }\n if(task.indexOf(cb) === -1) {\n task.push(cb);\n }\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n if(task[i] === cb) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n frame.offFrame(this.__rTask);\n }\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param width\n * @param height\n * @private\n */\n __checkRoot(width, height) {\n let { currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle.display) === -1) {\n computedStyle.display = currentStyle.display = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle.positoin === 'absolute') {\n computedStyle.position = currentStyle.positoin = 'static';\n }\n // 根节点满宽高\n currentStyle.width = {\n value: width,\n unit: PX,\n };\n currentStyle.height = {\n value: height,\n unit: PX,\n };\n computedStyle.width = width;\n computedStyle.height = height;\n // 继承值变默认,提前处理以便子节点根据parent计算\n css.computeMeasure(this, true);\n }\n\n /**\n * 添加更新入口,按节点汇总更新信息\n * @private\n */\n __addUpdate(o) {\n let updateHash = this.__updateHash;\n let { node, style, origin, overwrite, focus, img, measure } = o;\n // 事件队列和setState等原因,可能node已经销毁\n if(node.isDestroyed) {\n return;\n }\n // root特殊处理,检查变更时优先看继承信息\n if(node === this) {\n let target = this.__updateRoot;\n if(target) {\n if(img) {\n target.img = img;\n }\n if(focus) {\n target.focus = focus;\n }\n if(measure) {\n target.measure = true;\n }\n target.list = target.list || [];\n target.list.push({ style, origin, overwrite });\n }\n else {\n this.__updateRoot = {\n node,\n style,\n origin,\n overwrite,\n focus,\n img,\n measure,\n };\n }\n }\n else if(!node.hasOwnProperty('__uniqueUpdateId')) {\n node.__uniqueUpdateId = uniqueUpdateId;\n // 大多数情况节点都只有一次更新,所以优化首次直接存在style上,后续存在list\n updateHash[uniqueUpdateId++] = {\n node,\n style,\n origin,\n overwrite,\n focus,\n img,\n measure,\n };\n }\n else if(updateHash.hasOwnProperty(node.__uniqueUpdateId)) {\n let target = updateHash[node.__uniqueUpdateId];\n if(img) {\n target.img = img;\n }\n if(focus) {\n target.focus = focus;\n }\n if(measure) {\n target.measure = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n target.list = target.list || [];\n target.list.push({ style, origin, overwrite });\n }\n else {\n console.error('Update process miss uniqueUpdateId');\n }\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let measureList = [];\n let reflowList = [];\n let cacheHash = {};\n let cacheList = [];\n let updateRoot = this.__updateRoot;\n let updateHash = this.__updateHash;\n let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n this.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, this, updateHash, updateRoot, reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式\n this.__checkRoot(width, height);\n }\n // 汇总处理每个节点\n let keys = Object.keys(updateHash);\n keys.forEach(k => {\n hasUpdate = parseUpdate(renderMode, this, updateHash, updateHash[k], reflowList, measureList, cacheHash, cacheList) || hasUpdate;\n });\n // 先做一部分reset避免下面measureList干扰\n this.__reflowList = reflowList;\n uniqueUpdateId = 0;\n this.__updateHash = {};\n cacheList.forEach(item => {\n delete item.__uniqueUpdateId;\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __uniqueUpdateId, domParent: parent } = node;\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n let last = node;\n // 检查measure的属性是否是inherit\n let isInherit = change.isMeasureInherit(updateHash[__uniqueUpdateId].style);\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== this) {\n let { __uniqueUpdateId, currentStyle } = parent;\n let isInherit;\n if(parent.hasOwnProperty('__uniqueUpdateId')) {\n let style = updateHash[__uniqueUpdateId].style;\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.hasOwnProperty('__uniqueUpdateId')) {\n measureHash[target.__uniqueUpdateId] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n keys.forEach(k => {\n delete updateHash[k].node.__uniqueUpdateId;\n });\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响后面兄弟和父resize\n * 当flex变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响所有递归子节点和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 一般需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n\n // 单独提出共用检测影响的函数,非absolute和relative的offset情况从节点本身开始向上分析影响\n function checkInfluence(node, focus) {\n // 自身尺寸固定且无变化,无需向上查找,但position发生变化的除外\n if(isFixedSize(node, root) && !focus) {\n return;\n }\n // cp强制刷新\n if(node instanceof Component) {\n return;\n }\n let target = node;\n // inline新老都影响,节点变为最近的父非inline\n if(node.currentStyle.display === 'inline' || node.computedStyle.display === 'inline') {\n let parent = node.domParent;\n do {\n target = parent;\n // 父到root提前跳出\n if(parent === root) {\n return true;\n }\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 遇到absolute跳出,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 父固定宽度跳出直接父进行LAYOUT即可\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 继续向上\n parent = parent.domParent;\n }\n while(parent && (parent.currentStyle.display === 'inline' || parent.computedStyle.display === 'inline'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果原本是inline则是其非inline父\n let parent = target.domParent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 检查flex,如果父是flex,向上查找flex顶点视作其更改\n if(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex')) {\n do {\n target = parent;\n if(parent === root) {\n return true;\n }\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n parent = parent.domParent;\n }\n while(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果父原本是flex则是其最上flex父\n parent = target.domParent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 向上查找了并且没提前跳出的,父重新布局\n if(target !== node) {\n setLAYOUT(target, reflowHash);\n }\n }\n\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let { node, style, img } = reflowList[i];\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n let { currentStyle, computedStyle } = node;\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = {\n node,\n lv: OFFSET,\n img,\n };\n }\n let o = reflowHash[node.__uniqueReflowId];\n // absolute无变化,只影响自己\n if(currentStyle.position === 'absolute' && computedStyle.position === 'absolute') {\n o.lv = LAYOUT;\n }\n // absolute和非absolute互换\n else if(currentStyle.position !== computedStyle.position) {\n o.lv = LAYOUT;\n if(checkInfluence(node, true)) {\n hasRoot = true;\n break;\n }\n }\n // 所有其它变化\n else {\n let onlyXY = true;\n if(style) {\n let keys = Object.keys(style);\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n if(k !== 'left' && k !== 'top' && k !== 'right' && k !== 'bottom') {\n onlyXY = false;\n break;\n }\n }\n }\n // relative只有x/y变化时特殊只进行OFFSET,非relative的忽视掉这个无用影响\n // img加载特殊进到这里强制LAYOUT\n if(onlyXY && !img) {\n if(computedStyle.position === 'relative') {\n o.lv |= OFFSET;\n }\n }\n // 剩余的其它变化\n else {\n o.lv = LAYOUT;\n if(checkInfluence(node)) {\n hasRoot = true;\n break;\n }\n }\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n return [reflowList, [{\n node: this,\n lv: LAYOUT,\n }]];\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n let uniqueList = [];\n this.deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n delete node.__uniqueReflowId; // 清除掉\n if(o.lv >= LAYOUT) {\n options.uniqueList.push(o);\n }\n else {\n // OFFSET的话先递归看子节点,本身改变放在最后\n let uniqueList = [];\n node.deepScan(function(child, uniqueList) {}, { uniqueList });\n uniqueList.forEach(item => {\n options.uniqueList.push(item);\n });\n options.uniqueList.push(o);\n\n }\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n // 按顺序执行列表即可,上层LAYOUT先执行停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n uniqueList.forEach(item => {\n let { node, lv } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n if(lv >= LAYOUT) {\n let isLastAbs = node.computedStyle.position === 'absolute';\n let isNowAbs = node.currentStyle.position === 'absolute';\n let parent = node.domParent;\n let { layoutData: { x, y, w, h }, width, computedStyle } = parent;\n let ref;\n if(ref = node.prev) {\n y = ref.y;\n y += ref.outerHeight;\n }\n else {\n y = parent.y;\n y += computedStyle.marginTop + computedStyle.borderTopWidth + computedStyle.paddingTop;\n }\n x += computedStyle.marginLeft + computedStyle.borderLeftWidth + computedStyle.paddingLeft;\n let { outerWidth, outerHeight } = node;\n let change2Abs;\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n if(isNowAbs) {\n while(container.isShadowRoot) {\n container = container.host; // 先把可能递归嵌套的组件循环完\n }\n container = container.parent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute) {\n break;\n }\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n parent.__layoutAbs(container, null, node);\n // 一直abs无需偏移后面兄弟\n if(isLastAbs) {\n return;\n }\n change2Abs = true;\n }\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n if(node instanceof Dom) {\n if(!node.parent && node.host) {\n container = node; // 特殊判断component的sr为container\n }\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n // 记录重新布局引发的差值w/h,注意abs到非abs的切换情况\n let fromAbs = node.computedStyle.position === 'absolute';\n let dx, dy;\n if(change2Abs) {\n dx = -outerWidth;\n dy = -outerHeight;\n }\n else {\n let { outerWidth: ow, outerHeight: oh } = node;\n if(fromAbs) {\n dx = ow;\n dy = oh;\n }\n else {\n dx = ow - outerWidth;\n dy = oh - outerHeight;\n }\n }\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需递归,因为已经包含了\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle.position === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n // 如果有差值,偏移next兄弟,同时递归向上所有parent扩充和next偏移,直到absolute的中止\n if(dx || dy) {\n let p = node;\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(p.isShadowRoot) {\n p = p.host;\n }\n last = p;\n // 先偏移next,忽略有定位的absolute或LAYOUT\n let next = p.next;\n while(next) {\n if(next.currentStyle.position === 'absolute') {\n if(next.currentStyle.top.unit === AUTO && next.currentStyle.bottom.unit === AUTO) {\n next.__offsetY(dy, true, level.REFLOW);\n next.__cancelCache();\n }\n }\n else if(!next.hasOwnProperty('____uniqueReflowId') || reflowHash[next.____uniqueReflowId] < LAYOUT) {\n next.__offsetY(dy, true, level.REFLOW);\n next.__cancelCache();\n }\n next = next.next;\n }\n // 要么一定有parent,因为上面向上循环排除了cp返回cp的情况;要么就是root本身\n p = p.parent;\n if(p === root) {\n break;\n }\n // parent判断是否要resize\n let { currentStyle } = p;\n let isAbs = currentStyle.positoin === 'absolute';\n if(dx) {\n let need;\n // width在block不需要,parent一定不会是flex/inline\n if(isAbs) {\n if(currentStyle.width.unit === AUTO\n && (currentStyle.left.unit === AUTO || currentStyle.right.unit === AUTO)) {\n need = true;\n }\n }\n if(need) {\n p.__resizeX(dx);\n p.__cancelCache();\n p.__refreshLevel |= level.REFLOW;\n }\n }\n if(dy) {\n let need;\n if(isAbs) {\n if(currentStyle.height.unit === AUTO\n && (currentStyle.top.unit === AUTO || currentStyle.bottom.unit === AUTO)) {\n need = true;\n }\n }\n // height则需要\n else if(currentStyle.height.unit === AUTO) {\n need = true;\n }\n if(need) {\n p.__resizeY(dy);\n p.__cancelCache();\n p.__refreshLevel |= level.REFLOW;\n }\n // 高度不需要调整提前跳出\n else {\n break;\n }\n }\n }\n while(true);\n // 最后一个递归向上取消缓存,防止过程中重复next多次无用递归\n while(last) {\n last.__cancelCache();\n last = last.domParent;\n }\n }\n }\n // OFFSET操作的节点都是relative,要考虑auto变化\n else {\n let {\n currentStyle: { top, right, bottom, left }, currentStyle,\n computedStyle: { top: t, right: r, bottom: b, left: l }, computedStyle,\n } = node;\n let parent;\n if(node === this) {\n parent = node;\n }\n else {\n parent = node.domParent;\n }\n let newY = 0;\n if(top.unit !== AUTO) {\n newY = calRelative(currentStyle, 'top', top, parent);\n computedStyle.top = newY;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n newY = -calRelative(currentStyle, 'bottom', bottom, parent);\n computedStyle.bottom = -newY;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n let oldY = 0;\n if(t !== 'auto') {\n oldY = t;\n }\n else if(b !== 'auto') {\n oldY = -b;\n }\n if(newY !== oldY) {\n node.__offsetY(newY - oldY, false, level.REFLOW);\n }\n let newX = 0;\n if(left.unit !== AUTO) {\n newX = calRelative(currentStyle, 'left', left, parent);\n computedStyle.left = newX;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n newX = -calRelative(currentStyle, 'right', right, parent);\n computedStyle.right = -newX;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n let oldX = 0;\n if(l !== 'auto') {\n oldX = l;\n }\n else if(r !== 'auto') {\n oldX = -r;\n }\n if(newX !== oldX) {\n node.__offsetX(newX - oldX, false, level.REFLOW);\n }\n }\n });\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n return [reflowList, uniqueList];\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n\n get dom() {\n return this.__dom;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get 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 Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n originX,\n originY,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n let rebuild = this.buildCache(originX, originY);\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n d = painter.svgLine(x1, y1, x2, y2, controlA, controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS) {\n if(strokeWidth > 0) {\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve, dx, dy);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, curve, dx, dy);\n }\n ctx.stroke();\n ctx.closePath();\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get x1() {\n return this.getProps('x1');\n }\n\n get y1() {\n return this.getProps('y1');\n }\n\n get x2() {\n return this.getProps('x2');\n }\n\n get y2() {\n return this.getProps('y2');\n }\n\n get controlA() {\n return this.getProps('controlA');\n }\n\n get controlB() {\n return this.getProps('controlB');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n sx, sy,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n },\n isMulti, __cacheProps,\n } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 2;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n buildCache(originX, originY) {\n let { width, height, points, controls, start, end, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.points)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n if(isNil(__cacheProps.start)) {\n rebuild = true;\n __cacheProps.start = start;\n }\n if(isNil(__cacheProps.end)) {\n rebuild = true;\n __cacheProps.end = end;\n }\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = points.filter(item => Array.isArray(item)).map((item, i) => {\n let cl = controls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n __cacheProps.len = getLength(__cacheProps.list, isMulti);\n }\n else {\n __cacheProps.list = points.filter(item => Array.isArray(item)).map((point, i) => {\n if(i) {\n return concatPointAndControl(point, controls[i - 1]);\n }\n return point;\n });\n __cacheProps.len = getLength(__cacheProps.list, isMulti);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n originX,\n originY,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fillRule,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(originX, originY);\n let list = __cacheProps.list;\n if(isMulti) {\n __cacheProps.list2 = list.map((item, i) => {\n if(Array.isArray(item)) {\n let len = __cacheProps.len;\n return getNewList(item, {\n list: len.list[i],\n total: len.total[i],\n increase: len.increase[i],\n }, __cacheProps.start[i], __cacheProps.end[i]);\n }\n });\n }\n else {\n __cacheProps.list2 = getNewList(list, __cacheProps.len, __cacheProps.start, __cacheProps.end);\n }\n if(renderMode === mode.SVG) {\n if(isMulti) {\n let d = '';\n __cacheProps.list2.forEach(item => d += painter.svgPolygon(item));\n __cacheProps.d = d;\n }\n else {\n __cacheProps.d = painter.svgPolygon(__cacheProps.list2);\n }\n }\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.list2.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, __cacheProps.list2, dx, dy);\n }\n ctx.fill(fillRule === 'evenodd' ? fillRule : 'nonzero');\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(fillRule === 'evenodd') {\n props.push(['fill-rule', 'evenodd']);\n }\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get points() {\n return this.getProps('points');\n }\n\n get controls() {\n return this.getProps('controls');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], xb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], xb + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n return bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction getCoordsByDegree(x, y, r, d) {\n r = Math.max(r, 0);\n d = d % 360;\n if(d >= 0 && d < 90) {\n return [\n x + Math.sin(d * Math.PI / 180) * r,\n y - Math.cos(d * Math.PI / 180) * r\n ];\n }\n else if(d >= 90 && d < 180) {\n return [\n x + Math.cos((d - 90) * Math.PI / 180) * r,\n y + Math.sin((d - 90) * Math.PI / 180) * r,\n ];\n }\n else if(d >= 180 && d < 270) {\n return [\n x - Math.cos((270 - d) * Math.PI / 180) * r,\n y + Math.sin((270 - d) * Math.PI / 180) * r,\n ];\n }\n else {\n return [\n x - Math.sin((360 - d) * Math.PI / 180) * r,\n y - Math.cos((360 - d) * Math.PI / 180) * r,\n ];\n }\n}\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin)) {\n rebuild = true;\n __cacheProps.begin = begin;\n }\n if(isNil(__cacheProps.end)) {\n rebuild = true;\n __cacheProps.end = end;\n }\n if(isNil(__cacheProps.r)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge)) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure)) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.x1 = [];\n __cacheProps.x2 = [];\n __cacheProps.y1 = [];\n __cacheProps.y2 = [];\n __cacheProps.large = [];\n __cacheProps.d = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let [x1, y1] = getCoordsByDegree(cx, cy, r2, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r2, end[i] || 0);\n let large = ((end[i] || 0) - begin) > 180 ? 1 : 0;\n __cacheProps.x1.push(x1);\n __cacheProps.x2.push(x2);\n __cacheProps.y1.push(y1);\n __cacheProps.y2.push(y2);\n __cacheProps.large.push(large);\n });\n }\n else {\n let [x1, y1] = getCoordsByDegree(cx, cy, r, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r, end);\n let large = (end - begin) > 180 ? 1 : 0;\n __cacheProps.x1 = x1;\n __cacheProps.x2 = x2;\n __cacheProps.y1 = y1;\n __cacheProps.y2 = y2;\n __cacheProps.large = large;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n cx,\n cy,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { width, __cacheProps, isMulti } = this;\n this.buildCache(cx, cy);\n let { begin, end, r, x1, y1, x2, y2, edge, large, closure } = __cacheProps;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n begin.forEach((begin, i) => painter.canvasSector(ctx, cx, cy, r[i], x1[i], y1[i], x2[i], y2[i],\n strokeWidth, begin[i], end[i], large[i], edge[i], closure[i], dx, dy));\n }\n else {\n painter.canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure, dx, dy);\n }\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n this.__genSector(edge[i],\n painter.svgSector(cx, cy, r2, x1[i], y1[i], x2[i], y2[i], strokeWidth, large[i], edge[i], closure[i]),\n fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit\n );\n });\n }\n else {\n this.__genSector(edge,\n painter.svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure),\n fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit\n );\n }\n }\n return res;\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get edge() {\n return this.getProps('edge');\n }\n\n // >180°时是否链接端点\n get closure() {\n return this.getProps('closure');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n return bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\nimport util from \"../util/util\";\n\nlet { isNil } = util;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n originX,\n originY,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(originX, originY);\n let list = __cacheProps.list;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, list, dx, dy);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += painter.svgPolygon(item));\n }\n else {\n d = painter.svgPolygon(list);\n }\n let props = [\n ['d', d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n let { sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.min(bbox[2], originX + width + ox);\n bbox[3] = Math.min(bbox[3], originY + height + oy);\n return bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r)) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n cx,\n cy,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(cx, cy);\n let list = __cacheProps.list;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, list, dx, dy);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += painter.svgPolygon(item));\n }\n else {\n d = painter.svgPolygon(list);\n }\n let props = [\n ['d', d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n return bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n cx,\n cy,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(cx, cy);\n let list = __cacheProps.list;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, list, dx, dy);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += painter.svgPolygon(item));\n }\n else {\n d = painter.svgPolygon(list);\n }\n let props = [\n ['d', d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n return bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n};\n\nlet abbrCssProperty = {\n os: 'offset',\n e: 'easing',\n ft: 'filter',\n bd: 'boxShadow',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET).forEach(item => {\n let k = item.k;\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(target, vars) {\n if(target && vars) {\n Object.keys(target).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = target[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n console.error('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 只需将可能存在的children在遍历link一遍即可,如果children里有递归,前面因为出现过已经link过了\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let { id, children } = item;\n if(Array.isArray(children)) {\n children.forEach(child => {\n // 排除原始类型文本\n if(!isPrimitive(child)) {\n let { libraryId } = child;\n // ide中库文件的child来自于库一定有libraryId,但是为了编程特殊需求,放开允许存入自定义数据\n if(isNil(libraryId)) {\n return;\n }\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,属性和子图层来自库\n if(libraryItem) {\n linkChild(child, libraryItem);\n }\n else {\n throw new Error('Link library item miss libraryId: ' + libraryId);\n }\n }\n });\n }\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, vars, hash = {}) {\n if(isPrimitive(json) || json instanceof Node) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, vars, hash);\n });\n }\n let { library, libraryId } = json;\n // 有library说明是个mc节点,不会有init/animate和children链接,是个正常节点\n if(Array.isArray(library)) {\n hash = {};\n // 强制要求library的文件是排好顺序的,即元件和被引用类型在前面,引用的在后面,\n // 另外没有循环引用,没有递归library,先遍历设置引用,再递归进行连接\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 删除以免二次解析,有library一定没libraryId\n json.library = null;\n json.libraryId = null;\n }\n // ide中库文件的child一定有libraryId,有library时一定不会有libraryId\n else if(!isNil(libraryId) && hash) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n }\n let { tagName, props = {}, children = [], animate = [], __animateRecords } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, vars);\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else {\n vd = karas.createVd(tagName, props, children.map((item, i) => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, vars, hash);\n }));\n }\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n }\n let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport Controller from '../animate/Controller';\n\nexport default {\n parse(karas, json, dom, options = {}) {\n json = util.clone(json);\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options.vars);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__auto = ac.__auto.concat(animateRecords);\n ac.__playAuto();\n }\n else {\n ac.__records = ac.__records.concat(animateRecords);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n abbr,\n};\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\n\nexport default {\n css,\n reset,\n unit,\n font,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './geom/Geom';\nimport Line from './geom/Line';\nimport Polyline from './geom/Polyline';\nimport Polygon from './geom/Polygon';\nimport Sector from './geom/Sector';\nimport Rect from './geom/Rect';\nimport Circle from './geom/Circle';\nimport Ellipse from './geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\nupdater.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\n\nexport default karas;\n"],"names":["Node","__x","__y","__ox","__oy","__width","__height","__baseLine","diff","isLayout","__isDestroyed","x","ox","y","oy","__prev","__next","__parent","__domParent","undefined","p","root","parent","host","__root","__host","__virtualDom","CANVAS","SVG","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","arial","lhr","car","blr","TYPE_VD","_","TYPE_GM","TYPE_CP","identity","multiply","a","b","isPreIdA","isPreIdB","isSubIdA","isSubIdB","slice","c","calPoint","point","m","d","e","f","int2convolution","v","Math","floor","sqrt","PI","inverse","ar","br","cr","dr","er","fr","toString","isType","type","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","isNil","joinSourceArray","arr","res","i","len","length","item","Array","isArray","stringify","s","encodeHtml","prop","replace","joinVirtualDom","vd","defs","forEach","joinDef","bbClip","bb","joinVd","conClip","children","isMask","isClip","props","tagName","content","opacity","transform","visibility","mask","clip","filter","def","uuid","joinItem","rgba2int","color","charAt","push","parseInt","match","parseFloat","int2rgba","joinArr","arr2hash","hash","list","Object","keys","j","k","hash2arr","clone","$$type","util","Date","n","equalArr","ai","bi","isArrayA","isArrayB","equal","hasOwnProperty","getTime","extend","target","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__target","assigning","finished","__stayEnd","assignCurrentStyle","transformBbox","bbox","matrix","dx","dy","x1","y1","x2","y2","mx","xa","ya","xb","yb","min","max","isPrimitive","isAuto","position","gradient","img","H","vectorProduct","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","angleBySide","theta","pow","acos","pointsDistance","triangleIncentre","x3","y3","ellipsePoints","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","transformOrigin","calPercentInNode","ds","atan","d1","deg","Infinity","dt","d2","cos","sin","d2r","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","t","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","l","r","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","abs","bezierLength","points","startT","endT","at","at3","p0","p1","p2","p3","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","p4","x12","y12","x23","y23","x123","y123","x4","y4","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","end","reverse","h","unit","geom","getLinearDeg","exec","getRadialPosition","data","test","value","top","left","center","right","bottom","getColorStop","num","per","prev","allBefore","allAfter","first","last","getCsLimit","next","c1","c2","getCsStartLimit","getCsEndLimit","calLinearCoords","calRadialRadius","shape","size","iw","ih","xl","yl","r1","g1","b1","a1","r2","g2","b2","a2","l1","l2","g","parseGradient","reg","o","toLowerCase","indexOf","z","map","getLinear","w","stop","getRadial","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","fontFamily","fontStyle","fontWeight","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","justifyContent","alignItems","alignSelf","textAlign","zIndex","translateX","translateY","scaleX","scaleY","skewX","skewY","rotateZ","boxShadow","pointerEvents","GEOM","fill","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","fillRule","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","style","grow","shrink","basis","parseMarginPadding","key","temp","parseOneBorder","margin","padding","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","background","backgroundPosition","flex","translate","scale","rotate","skew","toFull","gd","repeat","bgc","join","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","KEY_EXPAND","EXPAND_HASH","IGNORE","REPAINT","MEASURE","isIgnore","isRepaint","isGeom","isMeasure","addGeom","ks","reset","MEASURE_KEY_SET","isMeasureInherit","measureInheritList","DEFAULT_FONT_SIZE","calUnit","compatibleTransform","normalize","abbr","console","error","bc","arr1","arr2","tfo","isNaN","blur","computeMeasure","isHost","currentStyle","parentComputedStyle","change","computeReflow","isRoot","calNormalLineHeight","setFontStyle","getBaseLine","normal","font","calRelativePercent","calRelative","isWidth","calAbsolute","equalStyle","oa","ob","av","bv","isMulti","isRelativeOrAbsolute","LineBox","__content","renderMode","ctx","cacheStyle","css","mode","fillText","Text","__lineBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","wait","MEASURE_TEXT","cache","CHAR_WIDTH_CACHE","needMeasure","char","mw","charWidth","measureText","isVirtual","isDestroyed","lineBoxes","begin","count","maxW","lineBox","__offsetX","__offsetY","textWidth","__layout","lv","fillStyle","render","virtualDom","cb","baseLine","__cacheStyle","prototype","__renderByMask","canvasPolygon","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","svgLine","OFFSET","canvasSector","large","edge","closure","arc","svgSector","calDeg","pointIndex","index","cross","pointByIndex","exchangeOrder","sx1","sy1","sx2","sy2","sx3","sy3","tx1","ty1","tx2","ty2","tx3","ty3","isOverflow","cross1","cross2","overflow","ls","lt","alpha","ls2","lt2","ax2","ay2","ax3","ay3","ab","ac","AB","AC","BC","A","tan","tar","math","calSingle","calMatrix","ow","oh","calMatrixByOrigin","t2","calMatrixWithOrigin","pointInQuadrilateral","normalizeSingle","calOrigin","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","free","mo","calDashed","m1","m2","m3","m4","bw","calPoints","deg1","deg2","direction","beginRadius","endRadius","isLast","main1","main2","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","beginLength","needInner","crossDeg","rx1","ry1","oyl","rx2","ry2","ca","calBezierTopLeft","controls1","controls2","limit","concat","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btw","brw","bbw","blw","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","VERTEX","FRAGMENT","initShaders","gl","vshader","fshader","program","createProgram","useProgram","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","initVertexBuffers","vertices","Float32Array","vertexBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","FSIZE","BYTES_PER_ELEMENT","aPosition","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","aTexCoord","projectionMatrix","getUniformLocation","uniformMatrix3fv","initLocation","uSampler","uOffset","uClamp","createAndSetupTexture","texture","createTexture","bindTexture","TEXTURE_2D","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","KawaseBlurFilter","webgl","quality","pixelStorei","UNPACK_FLIP_Y_WEBGL","vertexLocations","textureLocations","_pixelSize","pixelSize","_kernels","_blur","textures","framebuffers","texImage2D","UNSIGNED_BYTE","fbo","createFramebuffer","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","image","uOffsetArray","clear","uniform2f","viewport","uniform4f","drawArrays","TRIANGLE_STRIP","initBuffers","uniform1i","originalImageTexture","canvas","uvX","uvY","offset","_quality","draw","clearRect","drawImage","kernels","step","clearColor","COLOR_BUFFER_BIT","apply","round","_generateKernels","gaussBlur","SPF","WEBGL","document","createElement","setAttribute","karas","debug","body","appendChild","getContext","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","inject","html","chars","inline","div","innerHTML","cns","childNodes","window","getComputedStyle","text","__measureCb","removeChild","measureImg","url","state","task","Image","onload","success","onerror","substr","location","hostname","crossOrigin","src","warn","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","delCacheWebgl","isDom","Element","getElementsByTagName","Event","__eHash","handle","self","on","off","__karasEventCb","once","emit","event","fns","fn","traversal","before","after","isPause","Frame","__hookTask","__task","__taskBF","__now","taskBF","cloneBF","__init","animate","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","B","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","Error","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","unify","frames","currentProps","inherit","outerWidth","outerHeight","tf","genBeforeRefresh","animation","__addUpdate","__style","__assigning","__frameHook","framing","duration","es","time","transition","calDiff","pm","nm","pi","ni","pv","nv","innerWidth","eq","pp","np","v2","len2","pv2","nv2","v3","len3","pv3","nv3","calFrame","ts","binarySearch","frame","middle","getEasing","ea","timingFunction","steps","stepsD","ceil","calIntermediateStyle","o2","n2","st2","gotoOverload","options","lastCurrentTime","lastNextTime","Animation","__id","__list","nl","__options","op","__duration","delay","endDelay","iterations","fps","playbackRate","__easing","__playCount","spfLimit","__frames","__framesR","__startTime","currentTime","__nextTime","__fpsTime","__playState","current","unshift","copy","__keys","__originStyle","framesR","isFinish","__cancelTask","restore","__currentTime","__currentFrames","__currentFrame","__currentProps","__currentStyle","__hasFin","__begin","__end","__isDelay","__finish","__inFps","__enterFrame","FINISH","isDelay","FRAME","__firstPlay","PLAY","__playCb","playState","__hasCancel","firstEnter","is2","lastI","lastFrame","endTime","endTimeR","isAlternate","alternate","cfs","stayEnd","stayBegin","__stayBegin","enterFrame","playCount","currentFrames","__calDiffTime","isLastFrame","isLastCount","inEndDelay","__nextBegin","__clean","__frameCb","BEGIN","END","isEven","__fin","silence","pending","PAUSE","play","addRefreshTask","CANCEL","__goto","isFrame","excludeDelay","finish","spf","animateController","add","remove","backwards","both","forwards","sync","removeControl","nextFrame","__delay","__endDelay","__fps","__iterations","__fill","pause","resume","__direction","__playbackRate","__spfLimit","ENUM","NONE","TRANSLATE_X","TRANSLATE_Y","TRANSFORM","OPACITY","FILTER","VISIBILITY","REFLOW","TRANSFORMS","assign","contain","getLevel","isReflow","SIZE","MAX","HASH","Page","number","__size","__number","__free","__total","offScreen","__canvas","__offScreen","__grid","grid","pos","page","Cache","__bbox","__page","__pos","getCoords","__coords","__enabled","setTransform","globalAlpha","beginPath","rect","closePath","coords","xc","yc","dbx","dby","enabled","__available","del","getInstance","cacheFilter","old","newCache","nx","ny","dbx2","dby2","cacheMask","genMask","__cacheFilter","__cache","__opacity","drawCache","globalCompositeOperation","painter","TRANSFORM_ALL","level","renderBorder","xom","renderBgc","method","borderRadiusKs","calBorderRadius","noRadius","half","calBackgroundSize","calBackgroundPosition","container","renderBoxShadow","spread","inset","box","save","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","empty","Xom","__tagName","__computedStyle","__listener","__refreshLevel","listener","__loadBgi","__mpWidth","mp","fromAbs","__cancelCache","__layoutData","__mp","__layoutFlex","__layoutInline","__layoutBlock","__animateRecords","controller","autoPlay","__records","__auto","__playAuto","w2","h2","fixedWidth","fixedHeight","innerHeight","matrixCache","isScale","__matrix","loadBgi","delRefreshTask","focus","__gradient","k2","kw","__hasContent","cacheTotal","__cacheTotal","displayNone","canCache","displayAnimating","__lastDisplay","__blurValue","__sx","__sy","__calCache","domParent","matrixEvent","__matrixEvent","updateCache","visibilityAnimating","availableAnimating","hasContent","renderMatrix","__renderMatrix","__cacheMask","isImg","__appendData","bgX","bgY","needMask","xnl","xnr","ynt","ynb","needResize","__hasMask","__hasClip","isEmpty","sibling","mChildren","isTop","ref","owner","__destroy","force","__stopPropagation","__stopImmediatePropagation","willResponseEvent","inThis","__touchstartTarget","vs","__getLg","__getRg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","os","hasChange","origin","overwrite","cancel","layoutData","__spreadByBoxShadowAndFilter","animating","currentFrame","LineGroup","__calBaseLine","TAG_NAME","INLINE","BOLD","Dom","Img","Geom","Component","initRoot","cd","flattenJson","build","relation","initCp","json","hasP","klass","placeholder","__children","getRegister","traverseJson","lastText","shadowRoot","setUpdateFlag","cp","__hasUpdate","constructor","__ref","__state","__isMounted","__nextState","builder","__cd","__shadow","__shadowRoot","componentDidMount","REFRESH","componentWillUnmount","__emitEvent","__computeMeasure","defineProperty","get","ROOT","TOP","CHILD","REGISTER","__isMulti","multi","__isMask","__isClip","__cacheProps","isDirectionRow","main","__preLayout","__marginAuto","originX","originY","strokeDasharrayStr","strokeStyle","lineWidth","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preData","__preSet","__preSetCanvas","cacheTop","refreshMode","recursion","name","hasRegister","genZIndexChildren","dom","flow","needSort","lastIndex","child","__iIndex","__zIndex","sort","getMaskChildren","__lineGroups","block","none","tag","flowChildren","__tryLayInline","isRecursion","__calAutoBasis","min2","max2","__calMp","lineGroups","cw","lineGroup","fw","verticalAlign","horizonAlign","growList","shrinkList","basisList","minList","growSum","shrinkSum","basisSum","maxSum","maxCross","between","around","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__layoutAbs","blurValue","__mergeBbox","genOffScreenBlur","__noChildMask","hasMask","__renderAsMask","canCacheChildren","zIndexChildren","__zIndexChildren","maskChildren","__maskChildren","lv2","newCtx","ignoreGeom","offScreen2","hasMC","hasClip","drawMask","canCacheSelf","effectiveAnimating","isShadowRoot","__applyCache","bboxTotal","deepScan","loadImg","__loadImg","pts","__addGeom","Defs","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","shadow","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","nc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","oClip","nClip","isText","svg","where","insertBefore","Controller","args","init","__action","__set","getDom","querySelector","renderProp","initEvent","addEventListener","__wrapEvent","__cb","isFixedWidthOrHeight","isFixedSize","LAYOUT","isLAYOUT","__uniqueReflowId","setLAYOUT","addLAYOUT","uniqueUpdateId","parseUpdate","updateHash","reflowList","measureList","cacheHash","cacheList","measure","hasMeasure","hasZ","__uniqueUpdateId","Root","__dom","__mw","__mh","__scx","__scy","__updateList","__updateHash","__reflowList","__animateController","mix","getBoundingClientRect","touches","pageX","pageY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","toUpperCase","__genHtml","__uuid","__defs","getPropertyValue","__ctx","__renderMode","refresh","destroy","isFirst","__checkRoot","__checkUpdate","__checkReflow","__clear","__vd","__rTask","setStateList","updater","hookTask","positoin","__updateRoot","updateRoot","hasUpdate","measureHash","isInherit","hasRoot","reflowHash","checkInfluence","onlyXY","uniqueList","isLastAbs","isNowAbs","change2Abs","____uniqueReflowId","isAbs","__resizeX","__resizeY","newY","oldY","newX","oldX","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","rebuild","buildCache","curve","__propsStrokeStyle","getProps","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","Polyline","__points","__controls","controls","isControl","__getPoints","cl","list2","pointList","controlList","Polygon","getCoordsByDegree","getR","dft","Sector","__r","__edge","__closure","__genSector","genVertex","rx","ry","Rect","__rx","__ry","Circle","Ellipse","my","fullCssProperty","abbrCssProperty","ft","bd","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","fk","replaceVars","vars","linkLibrary","libraryId","libraryItem","linkChild","JSON","parse","animateRecords","library","createGm","createVd","animationRecord","has","register","version","appendTo","createCp","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAMA;EACJ,kBAAc;EAAA;;EACZ,SAAKC,GAAL,GAAW,CAAX;EACA,SAAKC,GAAL,GAAW,CAAX;EACA,SAAKC,IAAL,GAAY,CAAZ,CAHY;;EAIZ,SAAKC,IAAL,GAAY,CAAZ;EACA,SAAKC,OAAL,GAAe,CAAf;EACA,SAAKC,QAAL,GAAgB,CAAhB;EACA,SAAKC,UAAL,GAAkB,CAAlB,CAPY;EASZ;EACA;EACA;EACA;EACA;EACD;;;;gCAESC,MAAMC,UAAU;EACxB,UAAGA,QAAH,EAAa;EACX,aAAKR,GAAL,IAAYO,IAA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A7EU;EA8EVV,EAAAA,OAAO,EAAPA;EA9EU,CAAZ;EAiFApP,OAAO,CAAC1D,GAAR,CAAY;EACVzE,EAAAA,GAAG,EAAHA,GADU;EAEVwG,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;EAOAsR,OAAO,CAACxT,GAAR,CAAY;EACVzE,EAAAA,GAAG,EAAHA,GADU;EAEVwG,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAOtd,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACrB,KAAP,GAAeA,OAAf;EACD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/util/$$type.js","src/math/matrix.js","src/util/util.js","src/style/reg.js","src/math/geom.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/LineBox.js","src/node/Text.js","src/util/painter.js","src/math/tar.js","src/math/index.js","src/style/transform.js","src/style/border.js","src/style/image.js","src/style/blur.js","src/util/inject.js","src/util/Event.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/refresh/level.js","src/refresh/Page.js","src/refresh/Cache.js","src/node/Xom.js","src/node/LineGroup.js","src/node/tag.js","src/util/builder.js","src/node/Component.js","src/refresh/mode.js","src/geom/Geom.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/node/Root.js","src/geom/Line.js","src/geom/Polyline.js","src/geom/Polygon.js","src/geom/Sector.js","src/geom/Rect.js","src/geom/Circle.js","src/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/index.js","src/index.js"],"sourcesContent":["class Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n // 默认undefined\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 get domParent() {\n if(this.__domParent !== undefined) {\n return this.__domParent;\n }\n let p = this;\n let root = this.root;\n while(p) {\n if(p === root) {\n p = undefined;\n break;\n }\n if(p.parent) {\n p = p.parent;\n break;\n }\n if(p.host) {\n p = p.host;\n }\n }\n return this.__domParent = p || null;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n};\n","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","'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","// 类型为引用防止json仿造\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","// 生成3*3单位矩阵,css表达方法一维6位\nfunction identity() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n// 矩阵a*b,固定两个matrix都是长度6\nfunction multiply(a, b) {\n // 特殊情况优化\n let isPreIdA = a[0] === 1 && a[1] === 0 && a[2] === 0 && a[3] === 1;\n let isPreIdB = b[0] === 1 && b[1] === 0 && b[2] === 0 && b[3] === 1;\n let isSubIdA = a[4] === 0 && a[5] === 0;\n let isSubIdB = b[4] === 0 && b[5] === 0;\n if(isPreIdA && isSubIdA) {\n return b.slice(0);\n }\n if(isPreIdB && isSubIdB) {\n return a.slice(0);\n }\n if(isPreIdA && isPreIdB) {\n a = a.slice(0);\n a[4] += b[4];\n a[5] += b[5];\n return a;\n }\n else if(isPreIdA || isPreIdB) {\n let c = isPreIdA ? b.slice(0) : a.slice(0);\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n return c;\n }\n let c = [\n a[0] * b[0] + a[2] * b[1],\n a[1] * b[0] + a[3] * b[1],\n a[0] * b[2] + a[2] * b[3],\n a[1] * b[2] + a[3] * b[3],\n 0,\n 0,\n ];\n if(isSubIdA && isSubIdB) {\n }\n else if(isSubIdB) {\n c[4] = a[4];\n c[5] = a[5];\n }\n else {\n c[4] = a[0] * b[4] + a[2] * b[5] + a[4];\n c[5] = a[1] * b[4] + a[3] * b[5] + a[5];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y] = point;\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n}\n\nfunction int2convolution(v) {\n let d = Math.floor(v * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n d *= 3;\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * @param m\n */\nfunction inverse(m) {\n let [a, b, c, d, e, f] = m;\n if(a === 1 && b === 0 && c === 0 && d === 1 && e === 0 && f === 0) {\n return m;\n }\n let ar = 1;\n let br = 0;\n let cr = 0;\n let dr = 1;\n let er = 0;\n let fr = 0;\n // 先检查a是否为0,强制a为1\n if(a === 0) {\n if(b === 1) {\n [a, b, c, d, e, f, ar, br, cr, dr, er, fr] = [b, a, d, c, f, e, br, ar, dr, cr, fr, er];\n }\n else if(b === 0) {\n return [0, 0, 0, 0, 0, 0];\n }\n // R1 + R2/b\n else {\n a = 1;\n c += c / b;\n e += e / b;\n ar += ar / b;\n cr += cr / b;\n er += er / b;\n b = 0;\n }\n }\n // b/a=x,R2-R1*x,b为0可优化\n if(b !== 0) {\n let x = b / a;\n b = 0;\n d -= c * x;\n f -= e * x;\n br -= ar * x;\n dr -= cr * x;\n fr -= er * x;\n }\n // R1/a,a为0或1可优化\n if(a !== 1) {\n c /= a;\n e /= a;\n ar /= a;\n cr /= a;\n er /= a;\n a = 1;\n }\n // c/d=y,R1-R2*y,c为0可优化\n if(c !== 0) {\n let y = c / d;\n c = 0;\n e -= f * y;\n ar -= br * y;\n cr -= dr * y;\n er -= fr * y;\n }\n // 检查d是否为0,如果为0转成1,R2+1-R1\n if(d === 0) {\n d = 1;\n f += 1 - e;\n br += 1 - ar;\n dr += 1 - cr;\n fr += 1 - er;\n }\n // R2/d,d为1可优化\n else if(d !== 1) {\n f /= d;\n br /= d;\n dr /= d;\n fr /= d;\n d = 1;\n }\n // R1-R3*e,R2-R3*f,e/f为0可优化\n if(e !== 0) {\n er -= e;\n e = 0;\n }\n if(f !== 0) {\n fr -= f;\n f = 0;\n }\n return [ar, br, cr, dr, er, fr];\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n int2convolution,\n inverse,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = ' {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask || item.isClip) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, clip, filter } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n }\n else {\n res[0] = res[1] = res[2] = 0;\n }\n res[3] = 1;\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__target = nvd;\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(!equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n [x1, y1] = mx.calPoint([x1, y1], matrix);\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y] = mx.calPoint([x, y], matrix);\n xa = Math.min(xa, x);\n xb = Math.max(xa, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n return bbox;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n};\n\nexport default util;\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 mx from './matrix';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\n\n// 向量积\nfunction vectorProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(vectorProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y]\n ];\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { width, height, transformOrigin: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = mx.calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { width, height, transformOrigin: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - x * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return [x0, y0, x1, y1];\n }\n if(arguments.length === 6) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n if(arguments.length === 8) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\n/**\n * 范数 or 模\n */\nfunction norm(v) {\n let order = v.length;\n let sum = v.reduce((a, b) => Math.pow(a, order) + Math.pow(b, order));\n return Math.pow(sum, 1 / order);\n}\n\nfunction simpson38(derivativeFunc, l, r) {\n let f = derivativeFunc;\n let middleL = (2 * l + r) / 3;\n let middleR = (l + 2 * r) / 3;\n return (f(l) + 3 * f(middleL) + 3 * f(middleR) + f(r)) * (r - l) / 8;\n}\n\n/**\n * bezier 曲线的长度\n * @param derivativeFunc 微分函数\n * @param l 左点\n * @param r 右点\n * @param eps 精度\n * @return {*} number\n */\nfunction adaptiveSimpson38(derivativeFunc, l, r, eps = 0.001) {\n let f = derivativeFunc;\n let mid = (l + r) / 2;\n let st = simpson38(f, l, r);\n let sl = simpson38(f, l, mid);\n let sr = simpson38(f, mid, r);\n let ans = sl + sr - st;\n if(Math.abs(ans) <= 15 * eps) {\n return sl + sr + ans / 15;\n }\n return adaptiveSimpson38(f, l, mid, eps / 2) + adaptiveSimpson38(f, mid, r, eps / 2);\n}\n\n/**\n * bezier 曲线的长度\n * @param points 曲线的起止点 和 控制点\n * @param order 阶次, 2 和 3\n * @param startT 计算长度的起点,满足 0 <= startT <= endT <= 1\n * @param endT 计算长度的终点\n * @return {*} number\n */\nfunction bezierLength(points, order, startT = 0, endT = 1) {\n let derivativeFunc = t => norm(at(t, points, order));\n return adaptiveSimpson38(derivativeFunc, startT, endT);\n}\n\n/**\n * 3 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at3(t, points, order = 1) {\n let [p0, p1, p2, p3] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let [x3, y3] = p3;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 3) * x0 + 3 * t * Math.pow((1 - t), 2) * x1 + 3 * (1 - t) * Math.pow(t, 2) * x2 + Math.pow(t, 3) * x3;\n y = Math.pow((1 - t), 3) * y0 + 3 * t * Math.pow((1 - t), 2) * y1 + 3 * (1 - t) * Math.pow(t, 2) * y2 + Math.pow(t, 3) * y3;\n }\n else if(order === 1) {\n x = 3 * ((1 - t) * (1 - t) * (x1 - x0) + 2 * (1 - t) * t * (x2 - x1) + t * t * (x3 - x2));\n y = 3 * ((1 - t) * (1 - t) * (y1 - y0) + 2 * (1 - t) * t * (y2 - y1) + t * t * (y3 - y2));\n }\n else if(order === 2) {\n x = 6 * (x2 - 2 * x1 + x0) * (1 - t) + 6 * (x3 - 2 * x2 + x1) * t;\n y = 6 * (y2 - 2 * y1 + y0) * (1 - t) + 6 * (y3 - 2 * y2 + y1) * t;\n }\n else if(order === 3) {\n x = 6 * (x3 - 3 * x2 + 3 * x1 - x0);\n y = 6 * (y3 - 3 * y2 + 3 * y1 - y0);\n }\n else {\n // 3阶导数就是常数了,大于3阶的都是0\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * 2 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at2(t, points, order = 1) {\n let [p0, p1, p2] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 2) * x0 + 2 * t * (1 - t) * x1 + Math.pow(t, 2) * x2;\n y = Math.pow((1 - t), 2) * y0 + 2 * t * (1 - t) * y1 + Math.pow(t, 2) * y2;\n }\n else if(order === 1) {\n x = 2 * (1 - t) * (x1 - x0) + 2 * t * (x2 - x1);\n y = 2 * (1 - t) * (y1 - y0) + 2 * t * (y2 - y1);\n }\n else if(order === 2) {\n x = 2 * (x2 - 2 * x1 + x0);\n y = 2 * (y2 - 2 * y1 + y0);\n }\n else {\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\nfunction at(t, points, bezierOrder, derivativeOrder = 1) {\n if(bezierOrder === 2) {\n return at2(t, points, derivativeOrder);\n }\n else if(bezierOrder === 3) {\n return at3(t, points, derivativeOrder);\n }\n}\n\nfunction pointAtBezier(points, order, percent, maxIteration, eps) {\n let length = bezierLength(points, order, 0, 1);\n return pointAtBezierWithLength(points, order, length, percent, maxIteration, eps);\n}\n\nfunction pointAtBezierWithLength(points, order, length, percent = 1, maxIteration = 20, eps = 0.001) {\n let derivativeFunc = t => norm(at(t, points, order));\n let targetLen = length * percent;\n let approachLen = length;\n let approachT = percent;\n let preApproachT = approachT;\n for(let i = 0; i < maxIteration; i++) {\n approachLen = simpson38(derivativeFunc, 0, approachT);\n let d = approachLen - targetLen;\n if(Math.abs(d) < eps) {\n break;\n }\n // Newton 法\n let derivative1 = norm(at(approachT, points, order, 1)); // 1 阶导数\n let derivative2 = norm(at(approachT, points, order, 2)); // 2 阶导数\n let numerator = d * derivative1;\n let denominator = d * derivative2 + derivative1 * derivative1;\n approachT = approachT - numerator / denominator;\n if(Math.abs(approachT - preApproachT) < eps) {\n break;\n }\n else {\n preApproachT = approachT;\n }\n }\n return at(approachT, points, order, 0);\n}\n\nfunction sliceBezier(points, t) {\n let [[x1, y1], [x2, y2], [x3, y3], p4] = points;\n let x12 = (x2 - x1) * t + x1;\n let y12 = (y2 - y1) * t + y1;\n let x23 = (x3 - x2) * t + x2;\n let y23 = (y3 - y2) * t + y2;\n let x123 = (x23 - x12) * t + x12;\n let y123 = (y23 - y12) * t + y12;\n if(points.length === 4) {\n let [x4, y4] = p4;\n let x34 = (x4 - x3) * t + x3;\n let y34 = (y4 - y3) * t + y3;\n let x234 = (x34 - x23) * t + x23;\n let y234 = (y34 - y23) * t + y23;\n let x1234 = (x234 - x123) * t + x123;\n let y1234 = (y234 - y123) * t + y123;\n return [[x1, y1], [x12, y12], [x123, y123], [x1234, y1234]];\n }\n else if(points.length === 3) {\n return [[x1, y1], [x12, y12], [x123, y123]];\n }\n}\n\nfunction sliceBezier2Both(points, start = 0, end = 1) {\n start = Math.max(start, 0);\n end = Math.min(end, 1);\n if(start === 0 && end === 1) {\n return points;\n }\n if(end < 1) {\n points = sliceBezier(points, end);\n }\n if(start > 0) {\n if(end < 1) {\n start = start / end;\n }\n points = sliceBezier(points.reverse(), (1 - start)).reverse();\n }\n return points;\n}\n\nexport default {\n vectorProduct,\n pointInPolygon,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n },\n angleBySide,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n bezierLength,\n pointAtBezier,\n pointAtBezierWithLength,\n sliceBezier,\n sliceBezier2Both,\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","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'normal',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'stretch',\n alignSelf: 'auto',\n textAlign: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n scaleX: 1,\n scaleY: 1,\n skewX: 0,\n skewY: 0,\n rotateZ: 0,\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(temp) {\n let match = temp.toString().match(/(-?[\\d.]+(px|%)?)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+px\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,6}/i.exec(v);\n if(c && [4, 7].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderWidthTop', 'borderWidthRight', 'borderWidthBottom', 'borderWidthLeft'],\n borderColor: ['borderColorTop', 'borderColorRight', 'borderColorBottom', 'borderColorLeft'],\n borderStyle: ['borderStyleTop', 'borderStyleRight', 'borderStyleBottom', 'borderStyleLeft'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundRepeat: ['backgroundRepeatX', 'backgroundRepeatY'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-)?repeat(-[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n this.toFull(style, 'backgroundRepeat');\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, Math.max(0, parseFloat(v)), 1, 0);\n }\n else if(/^[\\d.]+px$/i.test(v)) {\n parseFlex(style, 1, 1, 0);\n }\n else if(/^[\\d.]+%$/.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], arr[1], 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+%$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, arr[0], 1, arr[1]);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n v = v.toString().split(/\\s+/);\n if(v.length === 1) {\n v[1] = '50%';\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[i];\n }\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n }\n};\n","const KEY_COLOR = [\n 'backgroundColor',\n 'borderBottomColor',\n 'borderLeftColor',\n 'borderRightColor',\n 'borderTopColor',\n 'color',\n];\n\nconst KEY_LENGTH = [\n 'fontSize',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopWidth',\n 'bottom',\n 'left',\n 'right',\n 'top',\n 'flexBasis',\n 'width',\n 'height',\n 'lineHeight',\n 'marginBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'strokeWidth',\n 'strokeMiterlimit',\n];\n\nconst KEY_GRADIENT = [\n 'backgroundImage',\n 'fill',\n 'stroke',\n];\n\nconst KEY_RADIUS = [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n};\n\nconst KEY_EXPAND = [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'rotateZ',\n 'skewX',\n 'skewY'\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\n\nlet o = {\n GEOM: {\n },\n IGNORE: {\n pointerEvents: true,\n },\n REPAINT: {\n transform: true,\n translateX: true,\n translateY: true,\n skewX: true,\n skewY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n color: true,\n fontStyle: true,\n strokeWidth: true,\n fill: true,\n strokeDasharray: true,\n strokeLinecap: true,\n strokeLinejoin: true,\n strokeMiterlimit: true,\n backgroundColor: true,\n backgroundImage: true,\n backgroundPositionX: true,\n backgroundPositionY: true,\n backgroundRepeat: true,\n backgroundSize: true,\n stroke: true,\n borderBottomColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n borderTopColor: true,\n borderTopLeftRadius: true,\n borderTopRightRadius: true,\n borderBottomRightRadius: true,\n borderBottomLeftRadius: true,\n visibility: true,\n opacity: true,\n zIndex: true,\n filter: true,\n boxShadow: true,\n },\n MEASURE: {\n fontSize: true,\n fontWeight: true,\n fontFamily: true,\n },\n isIgnore(k) {\n return this.IGNORE.hasOwnProperty(k);\n },\n isRepaint(k) {\n return this.REPAINT.hasOwnProperty(k) || this.isGeom(k);\n },\n isMeasure(k) {\n return this.MEASURE.hasOwnProperty(k);\n },\n addGeom(tagName, ks) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k);\n });\n }\n else if(ks) {\n let list = o.GEOM[ks] = o.GEOM[ks] || {};\n list[tagName] = true;\n }\n },\n isGeom(tagName, k) {\n return this.GEOM.hasOwnProperty(k) && this.GEOM[k].hasOwnProperty(tagName);\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(reset.DOM.hasOwnProperty(k)) {\n return true;\n }\n // geom的fill等矢量才有的样式\n if(tagName.charAt(0) === '$' && reset.GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(this.GEOM.hasOwnProperty(k)) {\n return this.GEOM[k].hasOwnProperty(tagName);\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(o.MEASURE);\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n return true;\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k].unit === unit.INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls', 'start', 'end']);\no.addGeom('$polygon', ['points', 'controls', 'start', 'end']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport util from '../util/util';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING } = unit;\nconst { isNil, rgba2int } = util;\n\nconst DEFAULT_FONT_SIZE = 16;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\n/**\n * 通用的格式化计算数值单位的方法,百分比像素auto和纯数字,直接修改传入对象本身\n * @param obj 待计算的样式对象\n * @param k 对象的key\n * @param v 对象的value\n * @returns 格式化好的样式对象本身\n */\nfunction calUnit(obj, k, v) {\n if(v === 'auto') {\n obj[k] = {\n unit: AUTO,\n };\n }\n else if(v === 'inherit') {\n obj[k] = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PERCENT,\n };\n }\n else if(/px$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: PX,\n };\n }\n else if(/deg$/i.test(v)) {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: DEG,\n };\n }\n else {\n v = parseFloat(v) || 0;\n obj[k] = {\n value: v,\n unit: NUMBER,\n };\n }\n // border相关不能为负值\n if(k.toString().indexOf('border') === 0) {\n obj[k].value = Math.max(obj[k].value, 0);\n }\n return obj;\n}\n\nfunction compatibleTransform(k, v) {\n if(k.indexOf('scale') > -1) {\n v.unit = NUMBER;\n }\n else if(k.indexOf('translate') > -1) {\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n }\n else {\n if(v.unit === NUMBER) {\n v.unit = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式\n * @returns Object 标准化的样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n delete style.border;\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n delete style[k];\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n delete style.borderWidth;\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n delete style.borderColor;\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n delete style.borderStyle;\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n delete style.borderRadius;\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n delete style.background;\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n delete style.backgroundPosition;\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n delete style.flex;\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n delete style.margin;\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n delete style.padding;\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n console.error(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n temp = style.rotate;\n if(!isNil(temp)) {\n abbr.toFull(style, 'rotate');\n delete style.rotate;\n }\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp) {\n // 区分是渐变色还是图\n if(reg.gradient.test(temp)) {\n style.backgroundImage = gradient.parseGradient(temp);\n }\n else if(reg.img.test(temp)) {\n style.backgroundImage = reg.img.exec(temp)[2];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,6}/i.exec(temp);\n if(bgc && [4, 7].indexOf(bgc[0].length) > -1) {\n style.backgroundColor = {\n value: rgba2int(bgc[0]),\n unit: RGBA,\n };\n }\n else {\n bgc = /rgba?\\(.+\\)/i.exec(temp);\n style.backgroundColor = {\n value: rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]),\n unit: RGBA,\n };\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n if(/%$/.test(temp) || /px$/i.test(temp) || /^-?[\\d.]+$/.test(temp)) {\n calUnit(style, k, temp);\n temp = style[k];\n if(temp.unit === NUMBER) {\n temp.unit = PX;\n }\n }\n else {\n style[k] = {\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[temp],\n unit: PERCENT,\n };\n }\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n let bc = style.backgroundSize = [];\n let match = temp.toString().match(/\\b(?:(-?[\\d.]+(px|%)?)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(bc, i, item);\n if(bc[i].unit === NUMBER) {\n bc[i].unit = PX;\n }\n }\n else if(item === '0' || item === 0) {\n bc.push({\n value: 0,\n unit: PX,\n });\n }\n else if(item === 'contain' || item === 'cover') {\n bc.push({\n value: item,\n unit: STRING,\n });\n }\n else {\n bc.push({\n unit: AUTO,\n });\n }\n }\n }\n else {\n bc.push({\n unit: AUTO,\n });\n bc[1] = bc[0];\n }\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n style[k] = {\n value: rgba2int(v),\n unit: RGBA,\n };\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(arr, i, item);\n if(arr[i].unit === NUMBER) {\n arr[i].unit = PX;\n }\n }\n else {\n arr[i] = {\n value: 0,\n unit: PX,\n };\n }\n }\n style[k] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = style.transform = [];\n let match = temp.toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push(['matrix', arr]);\n }\n }\n else if({\n 'translateX': true,\n 'translateY': true,\n 'scaleX': true,\n 'scaleY': true,\n 'skewX': true,\n 'skewY': true,\n 'rotate': true,\n 'rotateZ': true,\n }.hasOwnProperty(k)) {\n if(k === 'rotate') {\n k = 'rotateZ';\n }\n let arr = calUnit([k, v], 1, v);\n compatibleTransform(k, arr[1]);\n transform.push(arr);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n let arr1 = calUnit([k + 'X', arr[0]], 1, arr[0]);\n let arr2 = calUnit([k + 'Y', arr[1]], 1, arr[1]);\n compatibleTransform(k, arr1[1]);\n compatibleTransform(k, arr2[1]);\n transform.push(arr1);\n transform.push(arr2);\n }\n });\n }\n }\n temp = style.transformOrigin;\n if(!isNil(temp)) {\n let tfo = style.transformOrigin = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/%$/.test(item) || /px$/i.test(item) || /^-?[\\d.]+$/.test(item)) {\n calUnit(tfo, i, item);\n if(tfo[i].unit === NUMBER) {\n tfo[i].unit = PX;\n }\n }\n else {\n tfo.push({\n value: {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n unit: PERCENT,\n });\n // 不规范的写法变默认值50%\n if(isNil(tfo[i].value)) {\n tfo[i].value = 50;\n }\n }\n }\n }\n else {\n tfo.push({\n value: 50,\n unit: PERCENT,\n });\n tfo[1] = tfo[0];\n }\n }\n [\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'skewX',\n 'skewY',\n 'rotateZ',\n 'rotate'\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n if(k === 'rotate') {\n k = 'rotateZ';\n style.rotateZ = style.rotate;\n delete style.rotate;\n }\n // 没有单位或默认值处理单位\n v = style[k];\n compatibleTransform(k, v);\n });\n temp = style.opacity;\n if(temp) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n style.opacity = temp;\n }\n else {\n style.opacity = 1;\n }\n }\n temp = style.zIndex;\n if(temp) {\n style.zIndex = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n 'flexBasis',\n 'strokeWidth',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n calUnit(style, k, v);\n v = style[k];\n // 无单位视为px\n if(v.unit === NUMBER) {\n v.unit = PX;\n }\n });\n temp = style.color;\n if(temp) {\n if(temp === 'inherit') {\n style.color = {\n unit: INHERIT,\n };\n }\n else {\n style.color = {\n value: rgba2int(temp),\n unit: RGBA,\n };\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.fontSize = {\n unit: INHERIT,\n };\n }\n else if(/%$/.test(temp)) {\n let v = Math.max(0, parseFloat(temp));\n if(v) {\n style.fontSize = {\n value: v,\n unit: PERCENT,\n };\n }\n else {\n style.fontSize = {\n value: DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n else {\n style.fontSize = {\n value: Math.max(0, parseFloat(temp)) || DEFAULT_FONT_SIZE,\n unit: PX,\n };\n }\n }\n temp = style.fontWeight;\n if(temp || temp === 0) {\n if(temp === 'bold') {\n style.fontWeight = {\n value: 700,\n unit: NUMBER,\n };\n }\n else if(temp === 'normal') {\n style.fontWeight = {\n value: 400,\n unit: NUMBER,\n };\n }\n else if(temp === 'lighter') {\n style.fontWeight = {\n value: 200,\n unit: NUMBER,\n };\n }\n else if(temp === 'inherit') {\n style.fontWeight = {\n unit: INHERIT,\n };\n }\n else {\n style.fontWeight = {\n value: Math.max(0, parseInt(temp)) || 400,\n unit: NUMBER,\n };\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n style.fontStyle = {\n unit: INHERIT,\n };\n }\n else {\n style.fontStyle = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n style.fontFamily = {\n unit: INHERIT,\n };\n }\n else {\n style.fontFamily = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n style.textAlign = {\n unit: INHERIT,\n };\n }\n else {\n style.textAlign = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.lineHeight;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n style.lineHeight = {\n unit: INHERIT,\n };\n }\n else if(temp === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/px$/i.test(temp)) {\n style.lineHeight = {\n value: parseFloat(temp),\n unit: PX,\n };\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n style.lineHeight = {\n unit: AUTO,\n };\n }\n else {\n style.lineHeight = {\n value: n,\n unit: NUMBER,\n };\n }\n }\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n style.strokeDasharray = match;\n }\n else {\n style.strokeDasharray = [];\n }\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.fill = gradient.parseGradient(temp);\n }\n else {\n style.fill = rgba2int(temp);\n }\n }\n temp = style.stroke;\n if(temp) {\n if(temp.indexOf('-gradient(') > 0) {\n style.stroke = gradient.parseGradient(temp);\n }\n else {\n style.stroke = rgba2int(temp);\n }\n }\n temp = style.filter;\n if(temp) {\n style.filter = [];\n let blur = /\\bblur\\s*\\(\\s*([\\d.]+)\\s*(?:px)?\\s*\\)/i.exec(temp);\n if(blur) {\n let v = parseFloat(blur[1]) || 0;\n if(v) {\n style.filter.push(['blur', v]);\n }\n }\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n style.visibility = {\n unit: INHERIT,\n };\n }\n else {\n style.visibility = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n style.pointerEvents = {\n unit: INHERIT,\n };\n }\n else {\n style.pointerEvents = {\n value: temp,\n unit: STRING,\n };\n }\n }\n temp = style.boxShadow;\n if(temp) {\n style.boxShadow = [];\n let match = temp.match(/(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?)\\s+(-?[\\d.]+(px)?\\s*)?(-?[\\d.]+(px)?\\s*)?(((transparent)|(#[0-9a-f]{3,6})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n match.forEach(item => {\n let boxShadow = /(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?)\\s+(-?[\\d.]+(?:px)?\\s*)?(-?[\\d.]+(?:px)?\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,6})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n let res = [boxShadow[1], boxShadow[2], boxShadow[3] || 0, boxShadow[4] || 0, boxShadow[5] || '#000', boxShadow[6] || 'outset'];\n for(let i = 0; i < 4; i++) {\n calUnit(res, i, res[i]);\n // x/y可以负,blur和spread不行,没有继承且只有px无需保存单位\n if(i > 1 && res[i].value < 0) {\n res[i] = 0;\n }\n if(res[i].unit === NUMBER) {\n res[i] = res[i].value;\n }\n }\n res[4] = rgba2int(res[4]);\n style.boxShadow.push(res);\n }\n });\n }\n return style;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let parentComputedStyle = !isHost && parent.computedStyle;\n change.MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n if(v.unit === INHERIT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v.unit === PERCENT) {\n computedStyle[k] = isHost ? reset.INHERIT[k] : (parentComputedStyle[k] * v.value * 0.01);\n }\n else {\n computedStyle[k] = v.value;\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, parent } = node;\n let { textAlign, lineHeight } = currentStyle;\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ].forEach(k => {\n // border-width不支持百分比\n computedStyle[k] = (currentStyle[k].unit === PX) ? Math.max(0, currentStyle[k].value) : 0;\n });\n [\n 'position',\n 'display',\n 'flexDirection',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(textAlign.unit === INHERIT) {\n computedStyle.textAlign = isRoot ? 'left' : parentComputedStyle.textAlign;\n }\n else {\n computedStyle.textAlign = isRoot ? 'left' : textAlign.value;\n }\n if(lineHeight.unit === INHERIT) {\n computedStyle.lineHeight = isRoot ? calNormalLineHeight(computedStyle) : parentComputedStyle.lineHeight;\n }\n // 防止为0\n else if(lineHeight.unit === PX) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight.unit === NUMBER) {\n computedStyle.lineHeight = Math.max(lineHeight.value, 0) * computedStyle.fontSize || calNormalLineHeight(computedStyle);\n }\n // normal\n else {\n computedStyle.lineHeight = calNormalLineHeight(computedStyle);\n }\n}\n\nfunction setFontStyle(style) {\n let { fontStyle, fontWeight, fontSize, fontFamily } = style;\n return (fontStyle || 'normal') + ' ' + (fontWeight || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (fontFamily || 'arial');\n}\n\nfunction getBaseLine(style) {\n let normal = style.fontSize * font.arial.lhr;\n return (style.lineHeight - normal) * 0.5 + style.fontSize * font.arial.blr;\n}\n\nfunction calNormalLineHeight(computedStyle) {\n return computedStyle.fontSize * font.arial.lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style.unit === AUTO) {\n if(k === 'width') {\n parent = parent.parent;\n }\n else {\n break;\n }\n }\n else if(style.unit === PX) {\n return n * style.value;\n }\n else if(style.unit === PERCENT) {\n n *= style.value * 0.01;\n parent = parent.parent;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v.value, parent, 'width');\n }\n else {\n v = calRelativePercent(v.value, parent, 'height');\n }\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size) {\n if(v.unit === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v.unit) > -1) {\n v = v.value;\n }\n else if(v.unit === PERCENT) {\n v = v.value * size * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === 'transform') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n if(oa === 'matrix') {\n if(!util.equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n else if(!util.equal(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === 'filter') {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!util.equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === 'transformOrigin' || k === 'backgroundSize') {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a.value === b.value && a.unit === b.unit;\n }\n if(k === 'boxShadow') {\n return util.equalArr(a, b);\n }\n if(RADIUS_HASH.hasOwnProperty(k)) {\n return a[0].value === b[0].value && a[0].unit === b[0].unit\n && a[1].value === b[1].value && a[1].unit === b[1].unit;\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a.unit === b.unit && util.equalArr(a.value, b.value);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1].value !== bi[1].value || ai[1].unit !== bi[1].unit) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(change.isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return util.equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle.position;\n return position === 'relative' || position === 'absolute';\n}\n\nlet direct = {\n position: true,\n display: true,\n backgroundSize: true,\n backgroundRepeat: true,\n borderTopStyle: true,\n borderRightStyle: true,\n borderBottomStyle: true,\n borderLeftStyle: true,\n flexDirection: true,\n justifyContent: true,\n alignItems: true,\n alignSelf: true,\n flexGrow: true,\n flexShrink: true,\n strokeLinecap: true,\n strokeLinejoin: true,\n strokeMiterlimit: true,\n fillRule: true,\n};\nfunction clone(style) {\n let res = {};\n for(let k in style) {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n if(direct.hasOwnProperty(k)) {\n res[k] = v;\n }\n else if(k === 'filter' || k === 'transform' || k === 'strokeDasharray') {\n res[k] = util.extend({}, v);\n }\n else {\n res[k] = util.extend({}, v, ['value', 'unit']);\n }\n }\n }\n return res;\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n clone,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass LineBox {\n constructor(parent, x, y, w, content) {\n this.__parent = parent;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__content = content;\n this.__virtualDom = {};\n }\n\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox + dx;\n y += oy + dy;\n if(renderMode === mode.CANVAS) {\n ctx.fillText(content, x, y);\n }\n else if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props: [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle.color],\n ['font-family', computedStyle.fontFamily],\n ['font-weight', computedStyle.fontWeight],\n ['font-style', computedStyle.fontStyle],\n ['font-size', computedStyle.fontSize + 'px']\n ],\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return css.getBaseLine(this.parent.computedStyle);\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n}\n\nexport default LineBox;\n","import Node from './Node';\nimport LineBox from './LineBox';\nimport mode from './mode';\nimport css from '../style/css';\nimport util from '../util/util';\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__lineBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n static CHAR_WIDTH_CACHE = {};\n static MEASURE_TEXT = {\n list: [],\n data: {},\n };\n\n // 预先计算每个字的宽度\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n if(renderMode === mode.CANVAS) {\n ctx.font = css.setFontStyle(computedStyle);\n }\n let key = computedStyle.fontSize + ',' + computedStyle.fontFamily + ',' + computedStyle.fontWeight;\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 + ',' + computedStyle.fontWeight;\n let cache = Text.CHAR_WIDTH_CACHE[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n __layout(data, isVirtual) {\n let { x, y, w } = data;\n this.__x = x;\n this.__y = y;\n let { isDestroyed, content, computedStyle, lineBoxes, charWidthList } = this;\n if(isDestroyed || computedStyle.display === 'none') {\n return;\n }\n this.__ox = this.__oy = 0;\n lineBoxes.splice(0);\n // 顺序尝试分割字符串为lineBox,形成多行\n let begin = 0;\n let i = 0;\n let count = 0;\n let length = content.length;\n let maxW = 0;\n while(i < length) {\n count += charWidthList[i];\n if(count === w) {\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, i + 1));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n begin = i + 1;\n i = begin;\n count = 0;\n }\n else if(count > w) {\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行\n if(i === begin) {\n i = begin + 1;\n width = count;\n }\n else {\n width = count - charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, width, content.slice(begin, i));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, width);\n y += computedStyle.lineHeight;\n begin = i;\n count = 0;\n }\n else {\n i++;\n }\n }\n // 最后一行,只有一行未满时也进这里\n if(begin < length && begin < i) {\n count = 0;\n for(i = begin; i < length; i++) {\n count += charWidthList[i];\n }\n let lineBox = new LineBox(this, x, y, count, content.slice(begin, length));\n lineBoxes.push(lineBox);\n maxW = Math.max(maxW, count);\n y += computedStyle.lineHeight;\n }\n this.__width = maxW;\n this.__height = y - data.y;\n // flex/abs前置计算无需真正布局\n if(!isVirtual) {\n let { textAlign } = computedStyle;\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxes.forEach(lineBox => {\n let diff = this.__width - lineBox.width;\n if(diff > 0) {\n lineBox.__offsetX(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n }\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.lineBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n }\n\n __tryLayInline(w) {\n return w - this.textWidth;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\n }\n\n render(renderMode, lv, ctx, defs, dx = 0, dy = 0) {\n if(renderMode === mode.SVG) {\n this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n let { isDestroyed, computedStyle, lineBoxes, cacheStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || computedStyle.visibility === 'hidden') {\n return;\n }\n if(renderMode === mode.CANVAS) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle.color;\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n }\n lineBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle, dx, dy);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = lineBoxes.map(lineBox => lineBox.virtualDom);\n }\n }\n\n deepScan(cb) {\n cb(this);\n }\n\n __mergeBbox(matrix, tx, ty, dx, dy) {\n return util.transformBbox(this.bbox, matrix, dx, dy);\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get lineBoxes() {\n return this.__lineBoxes;\n }\n\n get charWidthList() {\n return this.__charWidthList;\n }\n\n get charWidth() {\n return this.__charWidth;\n }\n\n get textWidth() {\n return this.__textWidth;\n }\n\n get baseLine() {\n let { lineBoxes } = this;\n if(!lineBoxes.length) {\n return 0;\n }\n let last = lineBoxes[lineBoxes.length - 1];\n return last.y - this.y + last.baseLine;\n }\n\n get currentStyle() {\n return this.parent.currentStyle;\n }\n\n get computedStyle() {\n return this.parent.computedStyle;\n }\n\n get cacheStyle() {\n return this.parent.__cacheStyle;\n }\n\n get bbox() {\n let { sx, sy, width, height } = this;\n let x1 = sx, y1 = sy;\n let x2 = sx + width, y2 = sy + height;\n return [x1, y1, x2, y2];\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","function canvasPolygon(ctx, list, dx = 0, dy = 0) {\n if(!list || !list.length) {\n return;\n }\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n ctx.moveTo(list[start][0] + dx, list[start][1] + dy);\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0] + dx, item[1] + dy);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy, item[4] + dx, item[5] + dy);\n }\n }\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let s = 'M' + list[start][0] + ',' + list[start][1];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num, dx = 0, dy = 0) {\n ctx.moveTo(x1 + dx, y1 + dy);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0] + dx, controlA[1] + dy, controlB[0] + dx, controlB[1], x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0] + dx, controlB[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0] + dx, controlA[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else {\n ctx.lineTo(x2 + dx, y2 + dy);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nconst OFFSET = Math.PI * 0.5;\n\nfunction canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure, dx = 0, dy = 0) {\n ctx.arc(cx + dx, cy + dy, r, begin * Math.PI / 180 - OFFSET, end * Math.PI / 180 - OFFSET);\n if(edge) {\n if(!large || !closure) {\n ctx.lineTo(cx + dx, cy + dy);\n }\n ctx.lineTo(x1 + dx, y1 + dy);\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 + dx, cy + dy);\n }\n ctx.lineTo(x1 + dx, y1 + dy);\n }\n}\n\nfunction svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure) {\n let d = closure && large\n ? ('M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z')\n : ('M' + cx + ',' + cy + 'L' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2 + 'z');\n let d2;\n if(!edge || strokeWidth > 0) {\n d2 = 'M' + x1 + ',' + y1 + 'A' + r + ',' + r + ' 0 ' + large + ' 1 ' + x2 + ',' + y2;\n }\n return [d, d2];\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasSector,\n svgSector,\n};\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[4] = -sx1;\n m[5] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[4] = -tx1;\n n[5] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[3] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[2] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[3] = -m[3];\n m[5] = -m[5];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[4] = tx1;\n t[5] = ty1;\n m = matrix.multiply(t, m);\n return m;\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\n};\n","import unit from '../style/unit';\nimport math from '../math/index';\nimport util from '../util/util';\n\nconst { PX, PERCENT } = unit;\nconst { matrix, geom } = math;\nconst { identity, calPoint, multiply } = matrix;\nconst { d2r, pointInPolygon } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === 'translateX') {\n t[4] = v;\n }\n else if(k === 'translateY') {\n t[5] = v;\n }\n else if(k === 'scaleX') {\n t[0] = v;\n }\n else if(k === 'scaleY') {\n t[3] = v;\n }\n else if(k === 'skewX') {\n v = d2r(v);\n t[2] = Math.tan(v);\n }\n else if(k === 'skewY') {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === 'rotateZ') {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[3] = cos;\n t[1] = sin;\n t[2] = -sin;\n }\n else if(k === 'matrix') {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n }\n}\n\nfunction calMatrix(transform, ow, oh) {\n let list = normalize(transform, ow, oh);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n if(ox === 0 && oy === 0) {\n return m;\n }\n let t = identity();\n t[4] = ox;\n t[5] = oy;\n let res = multiply(t, m);\n let t2 = identity();\n t2[4] = -ox;\n t2[5] = -oy;\n res = multiply(res, t2);\n return res;\n}\n\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\n// 判断点是否在一个矩形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n [x1, y1] = calPoint([x1, y1], matrix);\n [x2, y2] = calPoint([x2, y2], matrix);\n [x3, y3] = calPoint([x3, y3], matrix);\n [x4, y4] = calPoint([x4, y4], matrix);\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\nfunction normalizeSingle(k, v, ow, oh) {\n if(k === 'translateX') {\n if(v.unit === PERCENT) {\n return v.value * ow * 0.01;\n }\n }\n else if(k === 'translateY') {\n if(v.unit === PERCENT) {\n return v.value * oh * 0.01;\n }\n }\n else if(k === 'matrix') {\n return v;\n }\n return v.value;\n}\n\nfunction normalize(transform, ow, oh) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item.unit === PX) {\n tfo.push(item.value);\n }\n else if(item.unit === PERCENT) {\n tfo.push(item.value * (i ? h : w) * 0.01);\n }\n });\n return tfo;\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n pointInQuadrilateral,\n};\n","/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nimport geom from '../math/geom';\n\nconst { H } = geom;\n\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btw boderTopWidth\n * @param brw borderRightWidth\n * @param bbw borderBottomWidth\n * @param blw borderLeftWidth\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n // 先减去对应borderWidth,因为border可能比较宽,弧度只体现在外圆弧,有可能radius为0减去后为负数需判断\n btlx -= blw;\n btly -= btw;\n btrx -= brw;\n btry -= btw;\n bbrx -= brw;\n bbry -= bbw;\n bblx -= blw;\n bbly -= bbw;\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n};\n","import unit from './unit';\nimport transform from './transform';\n\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n ['scaleX', {\n value: targetWidth / imgWidth,\n unit: NUMBER,\n }],\n ['scaleY', {\n value: targetHeight / imgHeight,\n unit: NUMBER,\n }]\n ];\n let tfo = transform.calOrigin([\n {\n value: 0,\n unit: PERCENT,\n },\n {\n value: 0,\n unit: PERCENT,\n }\n ], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","const VERTEX = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying vec2 vTextureCoord;\nuniform mat3 projectionMatrix;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}`;\n\nconst FRAGMENT = `\n#ifdef GL_ES\nprecision mediump float;\n#endif\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}`;\n\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if (!program) {\n console.error('Failed to create program');\n return false;\n }\n\n gl.useProgram(program);\n gl.program = program;\n\n return true;\n}\n\nfunction createProgram(gl, vshader, fshader) {\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if (!vertexShader || !fragmentShader) {\n return null;\n }\n\n let program = gl.createProgram();\n if (!program) {\n return null;\n }\n\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if (!linked) {\n let error = gl.getProgramInfoLog(program);\n console.error('Failed to link program: ' + error);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n return null;\n }\n return program;\n}\n\nfunction loadShader(gl, type, source) {\n let shader = gl.createShader(type);\n if (shader == null) {\n console.error('unable to create shader');\n return null;\n }\n\n gl.shaderSource(shader, source);\n\n gl.compileShader(shader);\n\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if (!compiled) {\n let error = gl.getShaderInfoLog(shader);\n console.error('Failed to compile shader: ' + error);\n gl.deleteShader(shader);\n return null;\n }\n\n return shader;\n}\n\nfunction initVertexBuffers(gl) {\n let vertices = new Float32Array([\n -1, 1, 0.0, 1.0,\n -1, -1, 0.0, 0.0,\n 1, 1, 1.0, 1.0,\n 1, -1, 1.0, 0.0\n ]);\n let vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n let FSIZE = Float32Array.BYTES_PER_ELEMENT;\n let aPosition = gl.getAttribLocation(gl.program, 'aVertexPosition');\n gl.vertexAttribPointer(aPosition, 2, gl.FLOAT, false, FSIZE * 4, 0);\n gl.enableVertexAttribArray(aPosition);\n let aTexCoord = gl.getAttribLocation(gl.program, 'aTextureCoord');\n gl.vertexAttribPointer(aTexCoord, 2, gl.FLOAT, false, FSIZE * 4, FSIZE * 2);\n\n let projectionMatrix = gl.getUniformLocation(gl.program, 'projectionMatrix');\n gl.uniformMatrix3fv(projectionMatrix, false, new Float32Array(\n [ 1, 0, 0,\n 0, 1, 0,\n 0, 0, 1 ]));\n gl.enableVertexAttribArray(aTexCoord);\n return {\n aPosition,\n aTexCoord,\n };\n}\n\nfunction initLocation(gl) {\n let uSampler = gl.getUniformLocation(gl.program, 'uSampler');\n let uOffset = gl.getUniformLocation(gl.program, 'uOffset');\n let uClamp = gl.getUniformLocation(gl.program, 'filterClamp');\n return {\n uSampler,\n uOffset,\n uClamp,\n };\n}\n\nfunction createAndSetupTexture(gl) {\n let texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n // 设置材质,这样我们可以对任意大小的图像进行像素操作\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n return texture;\n}\n\nclass KawaseBlurFilter {\n constructor(webgl, blur = 1, quality = 4) {\n this.webgl = webgl;\n let gl = this.gl = webgl.ctx;\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n initShaders(gl, VERTEX, FRAGMENT);\n this.vertexLocations = initVertexBuffers(gl);\n this.textureLocations = initLocation(gl);\n this._pixelSize = { x: 0, y: 0 };\n this.pixelSize = 1;\n this._kernels = null;\n this._blur = blur;\n this.quality = quality;\n // 创建两个纹理绑定到帧缓冲\n this.textures = [];\n this.framebuffers = [];\n }\n\n initBuffers(gl, width, height) {\n for (let i = 0; i < 2; i++) {\n let texture = createAndSetupTexture(gl);\n this.textures.push(texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n // 创建一个帧缓冲\n let fbo = gl.createFramebuffer();\n this.framebuffers.push(fbo);\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n // 绑定纹理到帧缓冲\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n }\n }\n\n draw(image, uOffsetArray, clear) {\n let { uOffset, uClamp } = this.textureLocations;\n let { gl } = this;\n gl.uniform2f(uOffset, uOffsetArray[0], uOffsetArray[1]);\n gl.viewport(0, 0, image.width, image.height);\n gl.uniform4f(uClamp, 0, 0, image.width, image.height);\n if (clear) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n }\n\n apply(target, width, height) {\n let { gl } = this;\n this.initBuffers(gl, width, height);\n let { uSampler } = this.textureLocations;\n gl.uniform1i(uSampler, 0);\n let originalImageTexture = createAndSetupTexture(gl);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, target.canvas);\n\n let uvX = this._pixelSize.x / width;\n let uvY = this._pixelSize.y / height;\n let offset;\n let last = this._quality - 1;\n // 从原始图像开始\n gl.bindTexture(gl.TEXTURE_2D, originalImageTexture);\n for (let i = 0; i < last; i++) {\n offset = this._kernels[i] + 0.5;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffers[i % 2]);\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, false);\n gl.bindTexture(gl.TEXTURE_2D, this.textures[i % 2]);\n }\n offset = this._kernels[last] + 0.5;\n let uOffsetArray = new Float32Array([ offset * uvX, offset * uvY ]);\n this.draw(target.canvas, uOffsetArray, true);\n this.webgl.draw();\n target.ctx.clearRect(0, 0, width, height);\n target.ctx.drawImage(gl.canvas, 0, 0);\n target.draw();\n return this;\n }\n\n /**\n * Auto generate kernels by blur & quality\n * @private\n */\n _generateKernels() {\n let blur = this._blur;\n let quality = this._quality;\n let kernels = [ blur ];\n\n if (blur > 0) {\n let k = blur;\n let step = blur / quality;\n\n for (let i = 1; i < quality; i++) {\n k -= step;\n kernels.push(k);\n }\n }\n\n this._kernels = kernels;\n }\n\n /**\n * The kernel size of the blur filter, for advanced usage.\n *\n * @member {number[]}\n * @default [0]\n */\n get kernels() {\n return this._kernels;\n }\n\n set kernels(value) {\n if (Array.isArray(value) && value.length > 0) {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max.apply(Math, value);\n } else {\n // if value is invalid , set default value\n this._kernels = [ 0 ];\n this._quality = 1;\n }\n }\n\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n *\n * @member {PIXI.Point|number[]}\n * @default [1, 1]\n */\n set pixelSize(value) {\n if (typeof value === 'number') {\n this._pixelSize.x = value;\n this._pixelSize.y = value;\n } else if (Array.isArray(value)) {\n this._pixelSize.x = value[0];\n this._pixelSize.y = value[1];\n } else {\n // if value is invalid , set default value\n this._pixelSize.x = 1;\n this._pixelSize.y = 1;\n }\n }\n\n get pixelSize() {\n return this._pixelSize;\n }\n\n /**\n * The quality of the filter, integer greater than `1`.\n *\n * @member {number}\n * @default 3\n */\n get quality() {\n return this._quality;\n }\n\n set quality(value) {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n }\n\n /**\n * The amount of blur, value greater than `0`.\n *\n * @member {number}\n * @default 4\n */\n get blur() {\n return this._blur;\n }\n\n set blur(value) {\n this._blur = value;\n this._generateKernels();\n }\n\n clear() {\n let gl = this.gl;\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n}\n\nfunction gaussBlur(target, webgl, blur, width, height) {\n return new KawaseBlurFilter(webgl, blur).apply(target, width, height);\n}\n\nexport default {\n gaussBlur,\n};\n","import Text from '../node/Text';\rimport util from './util';\r\rconst SPF = 1000 / 60;\r\rconst CANVAS = {};\rconst WEBGL = {};\r\rfunction cache(key, width, height, hash) {\r let o;\r if(!key) {\r o = document.createElement('canvas');\r }\r else if(!hash[key]) {\r o = hash[key] = document.createElement('canvas');\r }\r else {\r o = hash[key];\r }\r o.setAttribute('width', width + 'px');\r o.setAttribute('height', height + 'px');\r if(typeof karas !== 'undefined' && karas.debug) {\r o.style.width = width + 'px';\r o.style.height = height + 'px';\r o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\r if(key) {\r o.setAttribute('key', key);\r }\r document.body.appendChild(o);\r }\r return {\r canvas: o,\r ctx: hash === CANVAS ? o.getContext('2d')\r : (o.getContext('webgl') || o.getContext('experimental-webgl')),\r draw() {\r // 空函数,仅对小程序提供hook特殊处理,flush缓冲\r },\r available: true,\r release() {\r this.canvas = null;\r this.ctx = null;\r },\r };\r}\r\rfunction cacheCanvas(key, width, height) {\r return cache(key, width, height, CANVAS);\r}\r\rfunction cacheWebgl(key, width, height) {\r return cache(key, width, height, WEBGL);\r}\r\rconst IMG = {};\rconst INIT = 0;\rconst LOADING = 1;\rconst LOADED = 2;\r\rlet inject = {\r measureText(cb) {\r let { list, data } = Text.MEASURE_TEXT;\r let html = '';\r let keys = [];\r let chars = [];\r Object.keys(data).forEach(i => {\r let { key, style, s } = data[i];\r if(s) {\r let inline = `position:absolute;font-family:${style.fontFamily};font-size:${style.fontSize}px;font-weight:${style.fontWeight}`;\r for(let j = 0, len = s.length; j < len; j++) {\r keys.push(key);\r let char = s.charAt(j);\r chars.push(char);\r html += `${char.replace(/`;\r }\r }\r });\r if(!html) {\r cb();\r return;\r }\r let div = document.createElement('div');\r div.style.position = 'absolute';\r div.style.left = '99999px';\r div.style.top = '-99999px';\r div.style.visibility = 'hidden';\r document.body.appendChild(div);\r div.innerHTML = html;\r let cns = div.childNodes;\r let { CHAR_WIDTH_CACHE, MEASURE_TEXT } = Text;\r for(let i = 0, len = cns.length; i < len; i++) {\r let node = cns[i];\r let key = keys[i];\r let char = chars[i];\r // clientWidth只返回ceil整数,精度必须用getComputedStyle\r let css = window.getComputedStyle(node, null);\r CHAR_WIDTH_CACHE[key][char] = parseFloat(css.width);\r }\r list.forEach(text => text.__measureCb());\r cb();\r MEASURE_TEXT.list = [];\r MEASURE_TEXT.data = {};\r document.body.removeChild(div);\r },\r IMG,\r INIT,\r LOADED,\r LOADING,\r measureImg(url, cb) {\r let cache = IMG[url] = IMG[url] || {\r state: INIT,\r task: [],\r };\r if(cache.state === LOADED) {\r cb(cache);\r }\r else if(cache.state === LOADING) {\r cache.task.push(cb);\r }\r else {\r cache.state = LOADING;\r cache.task.push(cb);\r let img = new Image();\r img.onload = function() {\r cache.state = LOADED;\r cache.success = true;\r cache.width = img.width;\r cache.height = img.height;\r cache.source = img;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r img.onerror = function() {\r cache.state = LOADED;\r cache.success = false;\r cache.url = url;\r let list = cache.task.splice(0);\r list.forEach(cb => cb(cache));\r };\r if(url.substr(0, 5) !== 'data:') {\r let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\r if(host) {\r if(location.hostname !== host[1]) {\r img.crossOrigin = 'anonymous';\r }\r }\r }\r img.src = url;\r }\r },\r warn(s) {\r console.warn(s);\r },\r requestAnimationFrame(cb) {\r let res;\r if(typeof requestAnimationFrame !== 'undefined') {\r inject.requestAnimationFrame = requestAnimationFrame.bind(window);\r res = requestAnimationFrame(cb);\r }\r else {\r res = setTimeout(cb, SPF);\r inject.requestAnimationFrame = function(cb) {\r return setTimeout(cb, SPF);\r };\r }\r return res;\r },\r cancelAnimationFrame(id) {\r let res;\r if(typeof cancelAnimationFrame !== 'undefined') {\r inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\r res = cancelAnimationFrame(id);\r }\r else {\r res = clearTimeout(id);\r inject.cancelAnimationFrame = function(id) {\r return clearTimeout(id);\r };\r }\r return res;\r },\r now() {\r if(typeof performance !== 'undefined') {\r inject.now = function() {\r return Math.floor(performance.now());\r };\r return Math.floor(performance.now());\r }\r inject.now = Date.now.bind(Date);\r return Date.now();\r },\r hasCacheCanvas(key) {\r return key && CANVAS.hasOwnProperty(key);\r },\r getCacheCanvas(width, height, key) {\r return cacheCanvas(key, width, height);\r },\r delCacheCanvas(key) {\r key && delete CANVAS[key];\r },\r hasCacheWebgl(key) {\r return key && WEBGL.hasOwnProperty(key);\r },\r getCacheWebgl(width, height, key) {\r return cacheWebgl(key, width, height);\r },\r delCacheWebgl(key) {\r key && delete WEBGL[key];\r },\r isDom(o) {\r if(o) {\r if(util.isString(o)) {\r return true;\r }\r if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\r return true;\r }\r if(util.isFunction(o.getElementsByTagName)) {\r return true;\r }\r }\r return false;\r },\r};\r\rexport default inject;\r","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n on(id, handle) {\n if(!handle) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else if(handle) {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction } = util;\n\nfunction traversal(list, diff, step) {\n if(step === 'before') {\n list.forEach(item => {\n if(item && isFunction(item.before)) {\n item.before(diff);\n }\n });\n }\n else if(step === 'after') {\n list.forEach(item => {\n if(item && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__taskBF = [];\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task, taskBF } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || !task.length && !taskBF.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 cloneBF = taskBF.slice(0);\n let clone = task.slice(0);\n cloneBF.forEach(item => {\n item.before(diff);\n });\n traversal(clone, diff, 'before');\n // 执行动画造成的刷新并清空,在root的refreshTask回调中可能被清空,因为task已经刷新过了\n self.__hookTask.splice(0).forEach(item => item());\n // 普通的after\n cloneBF.forEach(item => {\n item.after(diff);\n });\n traversal(clone, diff, 'after');\n // 还有则继续,没有则停止节省性能\n if(task.length || taskBF.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task, taskBF } = this;\n if(!task.length && !taskBF.length) {\n this.__init();\n }\n task.push(handle);\n }\n\n __onFrameBF(animate) {\n let { task, taskBF } = this;\n if(!task.length && !taskBF.length) {\n this.__init();\n }\n taskBF.push(animate);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task, taskBF } = 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 && !taskBF.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n __offFrameBF(animate) {\n let { task, taskBF } = this;\n for(let i = 0, len = taskBF.length; i < len; i++) {\n let item = taskBF[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === animate) {\n animate.splice(i, 1);\n break;\n }\n }\n if(!task.length && !taskBF.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? diff => {\n handle(diff);\n this.offFrame(cb);\n } : {\n before: handle.before,\n after: diff => {\n handle.after && handle.after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n\n get taskBF() {\n return this.__taskBF;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n};\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\n\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER } = unit;\nconst { isNil, isFunction, isNumber, isObject, clone, equalArr } = util;\nconst { linear } = easing;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item.style;\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 空的过滤掉\n if(!isNil(v) && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(change.GEOM.hasOwnProperty(k)) {\n style[k] = target.currentProps[k];\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item.style;\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === 'transform') {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [['matrix', m]];\n }\n else if(v.unit === INHERIT) {\n if(k === 'color') {\n style[k] = {\n value: util.rgba2int(computedStyle[k]),\n unit: RGBA,\n };\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = {\n value: computedStyle[k],\n unit: PX,\n };\n }\n else if(k === 'fontWeight') {\n style[k] = {\n value: computedStyle[k],\n unit: NUMBER,\n };\n }\n else if(k === 'fontStyle' || k === 'fontFamily' || k === 'textAlign') {\n style[k] = {\n value: computedStyle[k],\n unit: STRING,\n };\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param animation\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, animation, root, node) {\n root.__addUpdate({\n node,\n style,\n });\n animation.__style = style;\n animation.__assigning = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n style = css.normalize(style);\n return {\n style,\n time: offset * duration,\n easing: easing || es,\n transition: [],\n };\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target) {\n let res = {\n k,\n };\n let p = prev[k];\n let n = next[k];\n if(k === 'transform') {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = [1, 0, 0, 1, 0, 0];\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = [1, 0, 0, 1, 0, 0];\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res.v = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n ];\n return res;\n }\n else if(k === 'filter') {\n // 目前只有1个blur,可以简单处理\n if(!p || !p.length) {\n res.v = n[0][1];\n }\n else if(!n || !n.length) {\n res.v = -p[0][1];\n }\n else {\n res.v = n[0][1] - p[0][1];\n }\n }\n else if(k === 'transformOrigin') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'outerHeight' : 'outerWidth'];\n res.v.push(v - pi.value);\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY') {\n if(p.unit === n.unit && [PX, PERCENT].indexOf(p.unit) > -1) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[k === 'backgroundPositionX' ? 'innerWidth' : 'innerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'boxShadow') {\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res.v.push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p.unit === n.unit) {\n let v = n.value - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PX && n.unit === PERCENT) {\n let v = n.value * 0.01 * target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v = n.value * 100 / target[/\\w+X$/.test(k) ? 'outerWidth' : 'outerHeight'];\n v = v - p.value;\n if(v === 0) {\n return;\n }\n res.v = v;\n }\n }\n else if(k === 'backgroundSize') {\n res.v = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi.unit === ni.unit && [PX, PERCENT].indexOf(pi.unit) > -1) {\n res.v.push(ni.value - pi.value);\n }\n else if(pi.unit === PX && ni.unit === PERCENT) {\n let v = ni.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else if(pi.unit === PERCENT && ni.unit === PX) {\n let v = ni.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.v.push(v - pi.value);\n }\n else {\n return;\n }\n }\n if(equalArr(res.v, [0, 0])) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n if(p.k !== n.k) {\n return;\n }\n // 渐变\n else if(p.k === 'linear' || p.k === 'radial') {\n let pv = p.v;\n let nv = n.v;\n if(equalArr(pv, nv)) {\n return;\n }\n res.v = [];\n let { innerWidth } = target;\n let eq;\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n eq = equalArr(t, [0, 0, 0, 0]);\n if(a[1] && b[1]) {\n if(a[1].unit === b[1].unit) {\n t.push(b[1].value - a[1].value);\n }\n else if(a[1].unit === PX && b[1].unit === PERCENT) {\n t.push(b[1].value * innerWidth * 0.01 - a[1].value);\n }\n else if(a[1].unit === PERCENT && b[1].unit === PX) {\n t.push(b[1].value * 100 / innerWidth - a[1].value);\n }\n if(eq) {\n eq = t[4] === 0;\n }\n }\n else if(a[1] || b[1]) {\n eq = false;\n }\n res.v.push(t);\n }\n // 线性渐变有角度差值变化\n if(p.k === 'linear') {\n let v = n.d - p.d;\n if(eq && v === 0) {\n return;\n }\n res.d = v;\n }\n // 径向渐变的位置\n else {\n res.p = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp.unit === np.unit) {\n res.p.push(np.value - pp.value);\n }\n else if(pp.unit === PX && np.unit === PERCENT) {\n let v = np.value * 0.01 * target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n else if(pp.unit === PERCENT && np.unit === PX) {\n let v = np.value * 100 / target[i ? 'innerWidth' : 'innerHeight'];\n res.p.push(v - pp.value);\n }\n }\n if(eq && equalArr(res.p, [0, 0])) {\n return;\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, p)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n.value;\n p = p.value;\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0].value === p[0].value && n[0].unit === p[0].unit\n && n[1].value === p[1].value && n[1].unit === p[1].unit) {\n return;\n }\n res.v = [];\n for(let i = 0; i < 2; i++) {\n if(n[i].unit === p[i].unit) {\n res.v.push(n[i].value - p[i].value);\n }\n else if(p[i].unit === PX && n[i].unit === PERCENT) {\n res.v.push(n[i].value * 0.01 * target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else if(p[i].unit === PERCENT && n[i].unit === PX) {\n res.v.push(n[i].value * 100 / target[i ? 'outerHeight' : 'outerWidth'] - p[i].value);\n }\n else {\n res.v.push(0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p.unit === AUTO || n.unit === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.parent || target).computedStyle;\n let diff = 0;\n if(p.unit === n.unit) {\n diff = n.value - p.value;\n }\n // 长度单位变化特殊计算,根据父元素computedStyle\n else if(p.unit === PX && n.unit === PERCENT) {\n let v;\n if(k === 'fontSize') {\n v = n.value * parentComputedStyle[k] * 0.01;\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.width * 0.01;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * parentComputedStyle.height * 0.01;\n }\n diff = v - p.value;\n }\n else if(p.unit === PERCENT && n.unit === PX) {\n let v;\n if(k === 'fontSize') {\n v = n.value * 100 / parentComputedStyle[k];\n }\n else if(k === 'flexBasis' && computedStyle.flexDirection === 'row' || k === 'width'\n || /margin/.test(k) || /padding/.test(k)\n || ['left', 'right'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.width;\n }\n else if(k === 'flexBasis' || k === 'height' || ['top', 'bottom'].indexOf(k) > -1) {\n v = n.value * 100 / parentComputedStyle.height;\n }\n diff = v - p.value;\n }\n // lineHeight奇怪的单位变化\n else if(k === 'lineHeight') {\n if(p.unit === PX && n.unit === NUMBER) {\n diff = n.value * computedStyle.fontSize - p.value;\n }\n else if(p.unit === NUMBER && n.unit === PX) {\n diff = n.value / computedStyle.fontSize - p.value;\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res.v = diff;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n res.v.push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res.v = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n res.v.push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res.v.push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || isNil(p) || equalArr(p, n)) {\n return;\n }\n res.v = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\n return;\n }\n else {\n res.v = n - p;\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n if(n === p) {\n return;\n }\n res.v = n - p;\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target) {\n keys.forEach(k => {\n let ts = calDiff(prev.style, next.style, k, target);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev.transition.push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame.time > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame.time === time) {\n return middle;\n }\n else if(frame.time > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\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];\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, percent, target) {\n let style = css.clone(frame.style);\n let timingFunction = getEasing(frame.easing);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame.transition;\n for(let i = 0, len = transition.length; i < len; i++) {\n let { k, v, d, p } = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === 'transform') {\n if(!st) {\n st = style[k] = [['matrix', [1, 0, 0, 1, 0, 0]]];\n }\n for(let i = 0; i < 6; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n else if(k === 'filter') {\n // 只有1个样式声明了filter另外一个为空\n if(!st) {\n st = style[k] = [['blur', 0]];\n }\n st[0][1] += v * percent;\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i].value += v[i] * percent;\n }\n }\n else if(k === 'backgroundPositionX' || k === 'backgroundPositionY'\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n if(v !== 0) {\n st.value += v * percent;\n }\n }\n else if(k === 'transformOrigin' || k === 'backgroundSize') {\n if(v[0] !== 0) {\n st[0].value += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1].value += v[1] * percent;\n }\n }\n else if(k === 'boxShadow') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n if(GRADIENT_TYPE.hasOwnProperty(st.k)) {\n for(let i = 0, len = Math.min(st.v.length, v.length); i < len; i++) {\n let a = st.v[i];\n let b = v[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1].value += b[1] * percent;\n }\n }\n if(st.k === 'linear' && st.d !== undefined && d !== undefined) {\n st.d += d * percent;\n }\n if(st.k === 'radial' && st.p !== undefined && p !== undefined) {\n st.p[0].value += p[0] * percent;\n st.p[1].value += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st.value;\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(change.GEOM.hasOwnProperty(k)) {\n let st = style[k];\n if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === 'opacity' || k === 'zIndex') {\n style[k] += v * percent;\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\nlet lastCurrentTime;\nlet lastNextTime;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n this.__target = target;\n this.__root = target.root;\n list = clone(list || []);\n if(Array.isArray(list)) {\n this.__list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n this.__list = nl;\n }\n else {\n this.__list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {};\n this.__duration = Math.max(0, parseFloat(op.duration) || 0);\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.iterations = op.iterations;\n this.fps = op.fps;\n this.fill = op.fill;\n this.direction = op.direction;\n this.playbackRate = op.playbackRate;\n this.__easing = op.easing;\n this.__playCount = 0;\n this.spfLimit = op.spfLimit; // 定帧功能,不跳帧,每帧时间限制为最大spf\n this.__frames = []; // 每帧数据\n this.__framesR = []; // 存储反向播放的数据\n this.__startTime = null;\n this.currentTime = 0; // 当前播放时间点,不包括暂停时长,但包括delay、变速,以此定位动画处于何时\n this.__nextTime = 0; // 下一帧刷新时间点,即currentTime下一帧被此赋值\n this.__fpsTime = 0;\n this.__playState = 'idle';\n this.__isDestroyed = false;\n this.__style = {};\n this.__assigning = false; // 本帧动画是否正在影响赋值style,即在事件的before之后after之前\n this.__init();\n }\n\n __init() {\n let { iterations, duration, list, easing, target } = this;\n // 执行次数小于1无需播放\n if(iterations < 1 || list.length < 1) {\n return;\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n this.__frames = frames;\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = this.__keys = unify(frames, target);\n inherit(frames, keys, target);\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let o = this.__originStyle = {};\n keys.forEach(k => {\n if(change.isGeom(tagName, k)) {\n o[k] = props[k];\n }\n o[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target);\n }\n // 反向存储帧的倒排结果\n let framesR = clone(frames).reverse();\n framesR.forEach(item => {\n item.time = duration - item.time;\n item.transition = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target);\n }\n this.__framesR = framesR;\n }\n\n __clean(isFinish) {\n this.__cancelTask();\n this.__nextTime = 0;\n let restore;\n let { style, duration, iterations, keys, target } = this;\n if(isFinish) {\n this.__currentTime = this.delay + duration + this.endDelay;\n this.__playCount = iterations;\n this.__playState = 'finished';\n // cancel需要清除finish根据情况保留\n if(!this.__stayEnd()) {\n this.__style = {};\n restore = true;\n }\n }\n else {\n this.__playCount = this.__currentTime = 0;\n this.__playState = 'idle';\n this.__style = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n this.__currentFrames = undefined;\n this.__currentFrame = undefined;\n keys.forEach(k => {\n if(change.GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __fin(cb, diff) {\n // 防止重复触发\n if(!this.__hasFin) {\n this.__hasFin = true;\n this.__begin = this.__end = this.__isDelay = this.__finish = this.__inFps = this.__enterFrame = null;\n this.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n }\n\n __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.call(this, diff, isDelay);\n this.__playCb = null;\n }\n }\n\n __calDiffTime(diff) {\n let { playbackRate, spfLimit, fps } = this;\n let v = this.__currentTime = this.__nextTime;\n if(lastCurrentTime === v) {\n this.__nextTime = lastNextTime;\n return v;\n }\n lastCurrentTime = v;\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 lastNextTime = this.__nextTime += diff;\n return v;\n }\n\n play(cb) {\n let { isDestroyed, duration, playState, 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 // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n let firstEnter = true;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!this.__enterFrame) {\n let {\n frames,\n framesR,\n direction,\n delay,\n endDelay,\n root,\n } = this;\n // 特殊优化缓存\n let length = frames.length, is2 = length === 2;\n let lastI, lastFrame, endTime, endTimeR;\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 初始化根据方向确定帧序列\n let cfs = this.__currentFrames = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n if(is2) {\n endTime = cfs[1].time;\n endTimeR = 1 / endTime;\n }\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 // 每帧执行的回调,firstEnter只有初次计算时有,第一帧强制不跳帧\n let enterFrame = this.__enterFrame = {\n before: diff => {\n let { target, fps, playCount, iterations, currentFrames } = this;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let currentTime = this.__calDiffTime(diff);\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!firstEnter && fps < 60) {\n diff = this.__fpsTime += diff;\n if(diff < 1000 / fps) {\n this.__inFps = true;\n return;\n }\n this.__fpsTime = 0;\n }\n firstEnter = false;\n // delay仅第一次生效\n if(playCount > 0) {\n delay = 0;\n }\n // 还没过前置delay\n else if(currentTime < delay) {\n if(stayBegin) {\n let current = frames[0].style;\n genBeforeRefresh(current, this, root, target);\n }\n // 即便不刷新,依旧执行begin和帧回调\n if(currentTime === 0) {\n this.__begin = true;\n }\n this.__isDelay = true;\n return;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0) {\n this.__begin = true;\n }\n // 只有2帧可优化,否则2分查找当前帧\n let i;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n }\n // 索引不同再重设currentFrame\n let current;\n if(lastI !== i) {\n lastI = i;\n current = this.__currentFrame = lastFrame = currentFrames[i];\n }\n else {\n current = lastFrame;\n }\n // 最后一帧结束动画\n let isLastFrame = i === length - 1;\n let isLastCount = playCount >= iterations - 1;\n let inEndDelay;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n if(isLastFrame) {\n // endDelay实际最后一次播放时生效,这里仅计算时间对比\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n // 多次播放时到达最后一帧也会显示\n if(stayEnd || !isLastCount) {\n current = current.style;\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = this.__originStyle;\n }\n // 非尾每轮次放完增加次数和计算下轮准备\n if(!isLastCount) {\n this.__nextTime = currentTime - duration;\n playCount = ++this.__playCount;\n this.__nextBegin = true;\n }\n // 尾次考虑endDelay\n else if(!inEndDelay) {\n this.__nextTime = 0;\n playCount = ++this.__playCount;\n // 判断次数结束每帧enterFrame调用,inEndDelay时不结束\n if(playCount >= iterations) {\n frame.offFrame(enterFrame);\n }\n }\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n let percent = currentTime * endTimeR;\n current = calIntermediateStyle(current, percent, target);\n }\n else {\n let total = currentFrames[i + 1].time - current.time;\n let percent = (currentTime - current.time) / total;\n current = calIntermediateStyle(current, percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, this, root, target);\n // 每次循环完触发end事件,最后一次循环触发finish\n if(isLastFrame && (!inEndDelay || isLastCount)) {\n this.__end = true;\n if(playCount >= iterations) {\n this.__finish = true;\n this.__clean(true);\n }\n }\n },\n after: diff => {\n this.__assigning = false;\n if(this.__inFps) {\n this.__inFps = false;\n return;\n }\n this.__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(isAlternate) {\n let isEven = this.playCount % 2 === 0;\n if(direction === 'alternate') {\n this.__currentFrames = isEven ? frames : framesR;\n }\n else {\n this.__currentFrames = isEven ? framesR : frames;\n }\n }\n }\n if(this.__finish) {\n this.__finish = false;\n this.__fin();\n }\n if(this.__nextBegin) {\n this.__nextBegin = false;\n this.__begin = true;\n }\n },\n };\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this.__enterFrame);\n frame.onFrame(this.__enterFrame);\n this.__startTime = frame.__now;\n return this;\n }\n\n pause(silence) {\n let { isDestroyed, duration, pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n this.__playState = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let { isDestroyed, duration, playState } = this;\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || list.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let { root, frames, __originStyle } = self;\n if(root) {\n let current;\n if(self.__hasFin) {\n self.__fin(cb, 0);\n return self;\n }\n // 停留在最后一帧\n if(self.__stayEnd()) {\n current = frames[frames.length - 1].style;\n }\n else {\n current = __originStyle;\n }\n root.addRefreshTask({\n before() {\n genBeforeRefresh(current, self, root, self.target);\n self.__clean(true);\n },\n after(diff) {\n self.__assigning = false;\n self.__frameCb(diff);\n self.__fin(cb, diff);\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let { isDestroyed, duration, playState, list } = self;\n if(isDestroyed || duration <= 0 || playState === 'idle' || list.length < 1) {\n return self;\n }\n self.__cancelTask();\n let { root, __originStyle } = self;\n if(root) {\n if(self.__hasCancel) {\n if(isFunction(cb)) {\n cb.call(self, 0);\n }\n return self;\n }\n let task = (diff) => {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n self.__cancelTask();\n self.__begin = self.__end = self.__isDelay = self.__finish = self.__inFps = self.__enterFrame = null;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n };\n root.addRefreshTask({\n before() {\n genBeforeRefresh(__originStyle, self, root, self.target);\n self.__clean();\n },\n after(diff) {\n self.__assigning = false;\n self.__frameCb(diff);\n task(diff);\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let { isDestroyed, duration, delay, endDelay } = this;\n if(isDestroyed || duration <= 0) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n this.__playState = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let { style, target, keys } = this;\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(change.GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let { duration, iterations, delay } = this;\n this.__playState = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += delay;\n }\n // 超过时间长度需要累加次数\n while(v > duration && this.playCount < iterations - 1) {\n this.__playCount++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n this.__nextTime = v;\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __cancelTask() {\n frame.offFrame(this.__enterFrame);\n this.__playCb = null;\n }\n\n __destroy(sync) {\n let self = this;\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean && self.__clean();\n self.__target = null;\n }\n else {\n frame.nextFrame({\n before() {\n // 尚未初始化的清除\n self.__clean && self.__clean();\n self.__target = null;\n },\n });\n }\n self.__startTime = null;\n self.__isDestroyed = true;\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__target;\n }\n\n get root() {\n return this.__root;\n }\n\n get keys() {\n return this.__keys;\n }\n\n get style() {\n return this.__style;\n }\n\n get list() {\n return this.__list;\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__duration;\n }\n\n set duration(v) {\n this.__duration = Math.max(0, parseFloat(v) || 0);\n }\n\n get delay() {\n return this.__delay;\n }\n\n set delay(v) {\n this.__delay = Math.max(0, parseFloat(v) || 0);\n }\n\n get endDelay() {\n return this.__endDelay;\n }\n\n set endDelay(v) {\n this.__endDelay = Math.max(0, parseFloat(v) || 0);\n }\n\n get fps() {\n return this.__fps;\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n if(v <= 0) {\n v = 60;\n }\n this.__fps = v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__iterations;\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n this.__iterations = v;\n }\n\n get fill() {\n return this.__fill;\n }\n\n set fill(v) {\n this.__fill = v || 'none';\n if(this.playState === 'running') {\n this.pause(true);\n this.resume();\n }\n }\n\n get direction() {\n return this.__direction;\n }\n\n set direction(v) {\n this.__direction = v || 'normal';\n if(this.playState === 'running') {\n this.pause(true);\n this.resume();\n }\n }\n\n get frames() {\n return this.__frames;\n }\n\n get framesR() {\n return this.__framesR;\n }\n\n get playbackRate() {\n return this.__playbackRate;\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n this.__playbackRate = v;\n }\n\n get easing() {\n return this.__easing;\n }\n\n get startTime() {\n return this.__startTime;\n }\n\n get currentTime() {\n return this.__currentTime;\n }\n\n set currentTime(v) {\n v = parseFloat(v) || 0;\n if(v >= 0) {\n this.__currentTime = this.__nextTime = v;\n }\n }\n\n get pending() {\n return this.playState !== 'running';\n }\n\n get finished() {\n return this.playState === 'finished';\n }\n\n get playState() {\n return this.__playState;\n }\n\n get playCount() {\n return this.__playCount;\n }\n\n // set playCount(v) {\n // this.__playCount = Math.max(0, parseInt(v) || 0);\n // }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n get animating() {\n let { playState } = this;\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || this.__stayEnd();\n }\n\n get spfLimit() {\n return this.__spfLimit;\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n this.__spfLimit = Math.max(v, parseInt(v) || 0);\n }\n else {\n this.__spfLimit = !!v;\n }\n }\n\n get assigning() {\n return this.__assigning;\n }\n\n get currentFrames() {\n return this.__currentFrames;\n }\n\n get currentFrame() {\n return this.__currentFrame;\n }\n}\n\nexport default Animation;\n","import change from './change';\n\nconst ENUM = {\n // 低4位表示repaint级别\n NONE: 0, // 0\n TRANSLATE_X: 1, // 1\n TRANSLATE_Y: 2, // 10\n TRANSFORM: 4, // 100\n OPACITY: 8, // 1000\n FILTER: 16, // 10000\n VISIBILITY: 32, // 100000\n REPAINT: 64, // 1000000\n\n // 高位表示reflow\n REFLOW: 128, // 10000000\n};\n\nconst TRANSFORMS = {\n // translateX: true,\n // translateY: true,\n scaleX: true,\n scaleY: true,\n rotateZ: true,\n transform: true,\n transformOrigin: true,\n};\n\nlet o = Object.assign({\n contain(lv, value) {\n return (lv & value) > 0;\n },\n /**\n * 得出等级\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(k === 'translateX') {\n return ENUM.TRANSLATE_X;\n }\n else if(k === 'translateY') {\n return ENUM.TRANSLATE_Y;\n }\n else if(TRANSFORMS.hasOwnProperty(k)) {\n return ENUM.TRANSFORM;\n }\n else if(k === 'opacity') {\n return ENUM.OPACITY;\n }\n else if(k === 'filter') {\n return ENUM.FILTER;\n }\n if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n}, ENUM);\no.TRANSFORMS = TRANSFORMS;\n\nexport default o;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096];\nlet NUMBER = [8, 8, 8, 8, 8, 8, 8, 4, 2, 1];\nlet MAX = 4096;\nconst HASH = {};\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n let offScreen = this.__canvas = inject.getCacheCanvas(size, size);\n if(offScreen) {\n this.__offScreen = offScreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n this.grid[pos] = 1;\n this.__free++;\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get size() {\n return this.__size;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offScreen() {\n return this.__offScreen;\n }\n\n get canvas() {\n return this.offScreen.canvas;\n }\n\n get ctx() {\n return this.offScreen.ctx;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH[s] = HASH[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offScreen) {\n console.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set MAX(v) {\n let n = v;\n while(n > 2) {\n n = n % 2;\n }\n if(n !== 0) {\n console.error('Page max-size must be a multiple of 2');\n return;\n }\n if(v < 8) {\n console.error('Page max-size must >= 8');\n return;\n }\n MAX = v;\n n = 1;\n SIZE = [];\n NUMBER = [];\n while(true) {\n SIZE.unshift(v);\n NUMBER.unshift(n);\n v >>= 1;\n // canvas太大初始化会卡,这里限制8个\n if(n < 8) {\n n <<= 1;\n }\n if(v < 8) {\n break;\n }\n }\n }\n\n static get MAX() {\n return MAX;\n }\n}\n\nexport default Page;\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport blur from '../style/blur';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\n\nclass Cache {\n constructor(w, h, bbox, page, pos) {\n this.__init(w, h, bbox, page, pos);\n }\n\n __init(w, h, bbox, page, pos) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n // 四周各+1px的扩展\n this.__coords = [x + 1, y + 1];\n if(page.canvas) {\n this.__enabled = true;\n let ctx = page.ctx;\n ctx.setTransform([1, 0, 0, 1, 0, 0]);\n ctx.globalAlpha = 1;\n if(typeof karas !== 'undefined' && karas.debug) {\n page.canvas.setAttribute('size', page.size);\n ctx.fillStyle = 'rgba(0, 0, 0, 0.1)';\n ctx.beginPath();\n ctx.rect(x + 1, y + 1, page.size - 2, page.size - 2);\n ctx.closePath();\n ctx.fill();\n }\n }\n }\n\n __appendData(x1, y1) {\n this.x1 = x1; // padding原点坐标\n this.y1 = y1;\n let [xc, yc] = this.coords;\n let bbox = this.bbox;\n this.dx = xc - bbox[0]; // cache坐标和box原点的差值\n this.dy = yc - bbox[1];\n this.dbx = x1 - bbox[0];\n this.dby = y1 - bbox[1];\n }\n\n clear() {\n let ctx = this.ctx;\n if(this.enabled && ctx && this.available) {\n ctx.setTransform([1, 0, 0, 1, 0, 0]);\n let [x, y] = this.coords;\n let size = this.page.size;\n ctx.clearRect(x - 1, y - 1, size, size);\n }\n this.__available = false;\n }\n\n release() {\n if(this.enabled) {\n this.clear();\n this.page.del(this.pos);\n this.__page = null;\n this.__enabled = false;\n }\n }\n\n reset(bbox) {\n // 尺寸没变复用之前的并清空\n if(util.equalArr(this.bbox, bbox) && this.enabled) {\n this.clear();\n return;\n }\n this.release();\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n w += 2;\n h += 2;\n // 防止边的精度问题四周各+1px,宽高即+2px\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n this.__enabled = false;\n return;\n }\n let { page, pos } = res;\n this.__init(w, h, bbox, page, pos);\n }\n\n // 是否功能可用,生成离屏canvas及尺寸超限\n get enabled() {\n return this.__enabled;\n }\n\n // 是否有可用缓存内容\n get available() {\n return this.enabled && this.__available;\n }\n\n get bbox() {\n return this.__bbox;\n }\n\n get page() {\n return this.__page;\n }\n\n get canvas() {\n return this.page.canvas;\n }\n\n get ctx() {\n return this.page.ctx;\n }\n\n get size() {\n return this.page.size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get pos() {\n return this.__pos;\n }\n\n get coords() {\n return this.__coords;\n }\n\n static getInstance(bbox) {\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n w += 2;\n h += 2;\n // 防止边的精度问题四周各+1px,宽高即+2px\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n return;\n }\n let { page, pos } = res;\n return new Cache(w, h, bbox, page, pos);\n }\n\n static genMask(cache) {\n let { size, x1, y1, width, height } = cache;\n let offScreen = inject.getCacheCanvas(width, height);\n offScreen.coords = [1, 1];\n offScreen.size = size;\n offScreen.x1 = x1;\n offScreen.y1 = y1;\n offScreen.dbx = cache.dbx;\n offScreen.dby = cache.dby;\n offScreen.width = width;\n offScreen.height = height;\n return offScreen;\n }\n\n /**\n * 复制cache的一块出来单独作为cacheFilter,尺寸边距保持一致,用webgl的滤镜\n * @param cache\n * @param v\n * @returns {{canvas: *, ctx: *, release(): void, available: boolean, draw()}}\n */\n static genOffScreenBlur(cache, v) {\n let { coords: [x, y], size, canvas, x1, y1, width, height } = cache;\n let offScreen = inject.getCacheCanvas(width, height);\n offScreen.ctx.drawImage(canvas, x - 1, y - 1, width, height, 0, 0, width, height);\n offScreen.draw();\n let cacheFilter = inject.getCacheWebgl(width, height);\n blur.gaussBlur(offScreen, cacheFilter, v, width, height);\n cacheFilter.coords = [1, 1];\n cacheFilter.size = size;\n cacheFilter.x1 = x1;\n cacheFilter.y1 = y1;\n cacheFilter.dbx = cache.dbx;\n cacheFilter.dby = cache.dby;\n cacheFilter.width = width;\n cacheFilter.height = height;\n return cacheFilter;\n }\n\n /**\n * bbox变化时直接用老的cache内容重设bbox\n * @param cache\n * @param bbox\n */\n static updateCache(cache, bbox) {\n let old = cache.bbox;\n if(!util.equalArr(bbox, old)) {\n let dx = old[0] - bbox[0];\n let dy = old[1] - bbox[1];\n let newCache = Cache.getInstance(bbox);\n if(newCache && newCache.enabled) {\n let { coords: [ox, oy], canvas, width, height } = cache;\n let { coords: [nx, ny] } = newCache;\n newCache.x1 = cache.x1;\n newCache.y1 = cache.y1;\n newCache.dx = cache.dx + dx;\n newCache.dy = cache.dy + dy;\n newCache.dbx = cache.dbx + dx;\n newCache.dby = cache.dby + dy;\n newCache.ctx.drawImage(canvas, ox - 1, oy - 1, width, height, dx + nx - 1, dy + ny - 1, width, height);\n newCache.__available = true;\n cache.release();\n return newCache;\n }\n }\n else {\n return cache;\n }\n }\n\n static drawCache(source, target, transform, matrix, tfo, inverse) {\n let { coords: [tx, ty], x1, y1, ctx, dbx, dby } = target;\n let { coords: [x, y], canvas, x1: x12, y1: y12, dbx: dbx2, dby: dby2, width, height } = source;\n let dx = tx + x12 - x1 + dbx - dbx2;\n let dy = ty + y12 - y1 + dby - dby2;\n if(transform && matrix && tfo) {\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n matrix = mx.multiply(matrix, m);\n if(inverse) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(matrix, inverse)) {\n matrix = [1, 0, 0, 1, 0, 0];\n }\n else {\n inverse = mx.inverse(inverse);\n matrix = mx.multiply(matrix, inverse);\n }\n }\n ctx.setTransform(...matrix);\n }\n ctx.drawImage(canvas, x - 1, y - 1, width, height, dx - 1, dy - 1, width, height);\n }\n\n static drawMask(target, next, transform, tfo) {\n let cacheMask = Cache.genMask(target);\n let list = [];\n while(next && (next.isMask || next.isClip)) {\n list.push(next);\n next = next.next;\n }\n let { coords: [x, y], ctx, dbx, dby } = cacheMask;\n tfo[0] += x + dbx;\n tfo[1] += y + dby;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n let cacheFilter = item.__cacheFilter, cache = item.__cache;\n let source = cacheFilter && cacheFilter.available && cacheFilter;\n if(!source) {\n source = cache && cache.available && cache;\n }\n if(source) {\n ctx.globalAlpha = item.__opacity;\n Cache.drawCache(\n source, cacheMask,\n item.computedStyle.transform,\n [1, 0, 0, 1, 0, 0],\n item.computedStyle.transformOrigin.slice(0),\n inverse\n );\n }\n else {\n console.error('CacheMask is oversize');\n }\n });\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = 'source-in';\n Cache.drawCache(target, cacheMask);\n ctx.globalCompositeOperation = 'source-over';\n cacheMask.draw(ctx);\n return cacheMask;\n }\n}\n\nexport default Cache;\n","import Node from './Node';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport gradient from '../style/gradient';\nimport border from '../style/border';\nimport css from '../style/css';\nimport image from '../style/image';\nimport blur from '../style/blur';\nimport abbr from '../style/abbr';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport Animation from '../animate/Animation';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\nimport Cache from '../refresh/Cache';\n\nconst { AUTO, PX, PERCENT, STRING, INHERIT } = unit;\nconst { clone, int2rgba, rgba2int, equalArr, extend, joinArr } = util;\nconst { calRelative } = css;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst TRANSFORM_ALL = level.TRANSFORM | level.TRANSLATE_X | level.TRANSLATE_Y;\n\nfunction renderBorder(renderMode, points, color, ctx, xom, dx, dy) {\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nfunction renderBgc(renderMode, color, x, y, w, h, ctx, xom, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr, method = 'fill') {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btw, brw, bbw, blw, btlr, btrr, bbrr, bblr);\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, w, h);\n }\n ctx[method]();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(list) {\n let d = svgPolygon(list);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color]\n ],\n });\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'rect',\n props: [\n ['x', x],\n ['y', y],\n ['width', w],\n ['height', h],\n ['fill', color]\n ],\n });\n }\n }\n}\n\nlet borderRadiusKs = ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'];\nfunction calBorderRadius(w, h, currentStyle, computedStyle) {\n let noRadius = true;\n borderRadiusKs.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item.value > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item.unit === PX) {\n return Math.max(0, item.value);\n }\n else {\n return Math.max(0, item.value * (i ? h : w) * 0.01);\n }\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n borderRadiusKs.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[borderRadiusKs[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBackgroundSize(value, w, h) {\n let res = [];\n value.forEach((item, i) => {\n if(item.unit === PX) {\n res.push(item.value);\n }\n else if(item.unit === PERCENT) {\n res.push(item.value * (i ? h : w) * 0.01);\n }\n else if(item.unit === AUTO) {\n res.push(-1);\n }\n else if(item.unit === STRING) {\n res.push(item.value === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size) {\n if(position.unit === PX) {\n return position.value;\n }\n else if(position.unit === PERCENT) {\n return (container - size) * position.value * 0.01;\n }\n return 0;\n}\n\nfunction renderBoxShadow(renderMode, ctx, defs, data, xom, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight) {\n let [x, y, blur, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(blur) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1, y4],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (blur > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, [\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = blur;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = mx.int2convolution(blur);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x4 + x - spread;\n let yb = y4 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x4, y1],\n [x4, y4],\n [x1 - n, y4],\n [x1 - n, y4 + n],\n [x4 + n, y4 + n],\n [x4 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y4],\n [x1, y4],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x4 + x + spread;\n let yb = y4 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let filter = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', blur * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n });\n let clip = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nfunction empty() {}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n this.__refreshLevel = level.REFLOW;\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n }\n\n // 获取margin/padding的实际值\n __mp(currentStyle, computedStyle, w) {\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left',\n ].forEach(k => {\n let a = 'margin' + k;\n let b = 'padding' + k;\n computedStyle[a] = this.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(mp, w) {\n if(mp.unit === PX) {\n return mp.value;\n }\n else if(mp.unit === PERCENT) {\n return mp.value * w * 0.01;\n }\n return 0;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,比如flex列计算时\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, !this.parent);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle } = this;\n let {\n display,\n width,\n position,\n } = currentStyle;\n this.__refreshLevel = level.REFLOW;\n this.__cancelCache();\n if(isDestroyed || display === 'none') {\n this.__width = this.__height = computedStyle.width = computedStyle.height = 0;\n return;\n }\n this.__layoutData = clone(data);\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n if(width.unit !== AUTO) {\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n this.__ox = this.__oy = 0;\n // 3种布局,默认block\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inline') {\n this.__layoutInline(data, isVirtual);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { top, right, bottom, left } = currentStyle;\n let { parent } = this;\n if(top.unit !== AUTO) {\n let n = calRelative(currentStyle, 'top', top, parent);\n this.__offsetY(n);\n computedStyle.top = n;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n let n = calRelative(currentStyle, 'bottom', bottom, parent);\n this.__offsetY(-n);\n computedStyle.bottom = n;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n if(left.unit !== AUTO) {\n let n = calRelative(currentStyle, 'left', left, parent, true);\n this.__offsetX(n);\n computedStyle.left = n;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n let n = calRelative(currentStyle, 'right', right, parent, true);\n this.__offsetX(-n);\n computedStyle.right = n;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n }\n else if(currentStyle.position !== 'absolute') {\n computedStyle.top = computedStyle.bottom = computedStyle.left = computedStyle.right = 'auto';\n }\n // 计算结果存入computedStyle\n computedStyle.width = this.width;\n computedStyle.height = this.height;\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records = ac.__records.concat(ar.list);\n }\n // 自动播放进入列表开始播放\n else {\n ac.__auto = ac.__auto.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data) {\n let { x, y, w, h, w2, h2 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n else if(width.unit !== AUTO) {\n fixedWidth = true;\n switch(width.unit) {\n case PX:\n w = width.value;\n break;\n case PERCENT:\n w *= width.value * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(height.unit !== AUTO) {\n fixedHeight = true;\n switch(height.unit) {\n case PX:\n h = height.value;\n break;\n case PERCENT:\n h *= height.value * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n y += borderTopWidth + marginTop + paddingTop;\n data.y = y;\n if(width.unit === AUTO) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height.unit === AUTO) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n position,\n marginLeft,\n marginRight,\n width,\n } = style;\n if(position !== 'absolute' && width !== AUTO && marginLeft.unit === AUTO && marginRight.unit === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calCache(renderMode, lv, ctx, defs, parent, __cacheStyle, currentStyle, computedStyle,\n sx, sy, innerWidth, innerHeight, outerWidth, outerHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n x1, x2, x3, x4, y1, y2, y3, y4) {\n let matrixCache = __cacheStyle.matrix;\n // tx/ty变化特殊优化\n if(matrixCache && lv < level.REFLOW && !level.contain(lv, level.TRANSFORM)) {\n let x = 0, y = 0;\n if(level.contain(lv, level.TRANSLATE_X)) {\n let v = currentStyle.translateX;\n if(util.isNil(v)) {\n v = 0;\n }\n else if(v.unit === PERCENT) {\n v = v.value * this.outerWidth * 0.01;\n }\n else {\n v = v.value;\n }\n x = v - (computedStyle.translateX || 0);\n computedStyle.translateX = v;\n }\n if(level.contain(lv, level.TRANSLATE_Y)) {\n let v = currentStyle.translateY;\n if(util.isNil(v)) {\n v = 0;\n }\n else if(v.unit === PERCENT) {\n v = v.value * this.outerHeight * 0.01;\n }\n else {\n v = v.value;\n }\n y = v - (computedStyle.translateY || 0);\n computedStyle.translateY = v;\n }\n matrixCache[4] += x;\n matrixCache[5] += y;\n __cacheStyle.matrix = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(__cacheStyle.transformOrigin === undefined) {\n __cacheStyle.transformOrigin = true;\n matrixCache = null;\n computedStyle.transformOrigin = tf.calOrigin(currentStyle.transformOrigin, outerWidth, outerHeight);\n }\n if(__cacheStyle.transform === undefined\n || __cacheStyle.translateX === undefined\n || __cacheStyle.translateY === undefined\n || __cacheStyle.rotateZ === undefined\n || __cacheStyle.scaleX === undefined\n || __cacheStyle.scaleY === undefined\n || __cacheStyle.skewX === undefined\n || __cacheStyle.skewY === undefined) {\n __cacheStyle.transform\n = __cacheStyle.translateX\n = __cacheStyle.translateY\n = __cacheStyle.rotateZ\n = __cacheStyle.scaleX\n = __cacheStyle.scaleY\n = __cacheStyle.skewX\n = __cacheStyle.skewY\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle.transform) {\n matrix = tf.calMatrix(currentStyle.transform, outerWidth, outerHeight);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n 'translateX',\n 'translateY',\n 'rotateZ',\n 'rotate',\n 'skewX',\n 'skewY',\n 'scaleX',\n 'scaleY',\n ].forEach(k => {\n let v = currentStyle[k];\n if(util.isNil(v)) {\n return;\n }\n computedStyle[k] = v.value;\n // scale为1和其它为0避免计算浪费\n let isScale = k.indexOf('scale') > -1;\n if(v.value === 1 && isScale || !isScale && v.value === 0) {\n return;\n }\n if(v.unit === PERCENT) {\n if(k === 'translateX') {\n computedStyle[k] = v.value * outerWidth * 0.01;\n }\n else if(k === 'translateY') {\n computedStyle[k] = v.value * outerHeight * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, outerWidth, outerHeight);\n }\n }\n this.__matrix = computedStyle.transform = matrix || [1, 0, 0, 1, 0, 0];\n }\n }\n if(lv >= level.REPAINT) {\n if(__cacheStyle.backgroundPositionX === undefined) {\n __cacheStyle.backgroundPositionX = true;\n let {\n backgroundPositionX,\n } = currentStyle;\n computedStyle.backgroundPositionX = backgroundPositionX.unit === PX\n ? backgroundPositionX.value : backgroundPositionX.value * innerWidth + '%';\n }\n if(__cacheStyle.backgroundPositionY === undefined) {\n __cacheStyle.backgroundPositionY = true;\n let {\n backgroundPositionY,\n } = currentStyle;\n computedStyle.backgroundPositionY = backgroundPositionY.unit === PX\n ? backgroundPositionY.value : backgroundPositionY.value * innerWidth + '%';\n }\n if(__cacheStyle.backgroundSize === undefined) {\n __cacheStyle.backgroundSize = true;\n computedStyle.backgroundSize = calBackgroundSize(currentStyle.backgroundSize, innerWidth, innerHeight);\n }\n if(__cacheStyle.backgroundImage === undefined) {\n let backgroundImage = computedStyle.backgroundImage = currentStyle.backgroundImage;\n // 防止隐藏不加载背景图\n if(util.isString(backgroundImage)) {\n __cacheStyle.backgroundImage = true;\n let loadBgi = this.__loadBgi;\n let cache = inject.IMG[backgroundImage];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = backgroundImage;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n if(loadBgi.url !== backgroundImage) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = backgroundImage;\n loadBgi.source = null;\n inject.measureImg(backgroundImage, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.__isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n let node = this;\n let root = node.root;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n before() {\n root.__addUpdate({\n node,\n focus: level.REPAINT,\n });\n },\n });\n }\n }, {\n width: innerWidth,\n height: innerHeight,\n });\n }\n }\n else if(backgroundImage && backgroundImage.k) {\n __cacheStyle.backgroundImage = this.__gradient(renderMode, ctx, defs, x2, y2, x3, y3, innerWidth, innerHeight, backgroundImage);\n }\n }\n if(__cacheStyle.boxShadow === undefined) {\n __cacheStyle.boxShadow = true;\n computedStyle.boxShadow = currentStyle.boxShadow;\n }\n // 这些直接赋值的不需要再算缓存\n [\n 'opacity',\n 'zIndex',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundRepeat',\n 'filter',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n [\n 'backgroundColor',\n 'borderTopColor',\n 'borderRightColor',\n 'borderBottomColor',\n 'borderLeftColor',\n ].forEach(k => {\n if(__cacheStyle[k] === undefined) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k].value);\n }\n });\n // 圆角边计算\n if(__cacheStyle.borderTopLeftRadius === undefined\n || __cacheStyle.borderTopRightRadius === undefined\n || __cacheStyle.borderBottomRightRadius === undefined\n || __cacheStyle.borderBottomLeftRadius === undefined) {\n __cacheStyle.borderTopLeftRadius\n = __cacheStyle.borderTopRightRadius\n = __cacheStyle.borderBottomRightRadius\n = __cacheStyle.borderBottomLeftRadius\n = true;\n calBorderRadius(outerWidth, outerHeight, currentStyle, computedStyle);\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n __cacheStyle['border' + k] = undefined;\n });\n }\n let {\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n } = computedStyle;\n // width/style/radius影响border,color不影响渲染缓存\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n let k2 = 'border' + k;\n let kw = k2 + 'Width';\n let ks = k2 + 'Style';\n if(__cacheStyle[kw] === undefined) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(__cacheStyle[ks] === undefined) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(__cacheStyle[k2] === undefined) {\n if(k === 'Top') {\n if(borderTopWidth > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 0,\n borderTopLeftRadius, borderTopRightRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k === 'Right') {\n if(borderRightWidth > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 1,\n borderTopRightRadius, borderBottomRightRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k === 'Bottom') {\n if(borderBottomWidth > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 2,\n borderBottomLeftRadius, borderBottomRightRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k === 'Left') {\n if(borderLeftWidth > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x3, x4, y1, y2, y3, y4, 3,\n borderTopLeftRadius, borderBottomLeftRadius);\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n }\n else {\n if(level.contain(lv, level.OPACITY)) {\n computedStyle.opacity = currentStyle.opacity;\n }\n if(level.contain(lv, level.FILTER)) {\n computedStyle.filter = currentStyle.filter;\n }\n }\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle.fontStyle.unit === INHERIT) {\n computedStyle.fontStyle = parent ? parentComputedStyle.fontStyle : 'normal';\n }\n else if(!__cacheStyle.fontStyle) {\n computedStyle.fontStyle = currentStyle.fontStyle.value;\n }\n __cacheStyle.fontStyle = computedStyle.fontStyle;\n if(currentStyle.color.unit === INHERIT) {\n computedStyle.color = parent ? parentComputedStyle.color : [0, 0, 0, 1];\n __cacheStyle.color = int2rgba(computedStyle.color);\n }\n else if(!__cacheStyle.color) {\n computedStyle.color = rgba2int(currentStyle.color.value);\n __cacheStyle.color = int2rgba(computedStyle.color);\n }\n if(currentStyle.visibility.unit === INHERIT) {\n computedStyle.visibility = parent ? parentComputedStyle.visibility : 'visible';\n }\n else if(!__cacheStyle.visibility) {\n computedStyle.visibility = currentStyle.visibility.value;\n }\n __cacheStyle.visibility = computedStyle.visibility;\n if(currentStyle.pointerEvents.unit === INHERIT) {\n computedStyle.pointerEvents = parent ? parentComputedStyle.pointerEvents : 'auto';\n }\n else if(!__cacheStyle.pointerEvents) {\n computedStyle.pointerEvents = currentStyle.pointerEvents.value;\n }\n __cacheStyle.pointerEvents = computedStyle.pointerEvents;\n if(!matrixCache) {\n let tfo = computedStyle.transformOrigin.slice(0);\n tfo[0] += sx;\n tfo[1] += sy;\n __cacheStyle.matrix = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n }\n // 决定是否缓存位图的指数,有内容就缓存,空容器无内容\n if(renderMode === mode.CANVAS) {\n if(lv < level.REPAINT) {\n return this.__hasContent;\n }\n let backgroundImage = __cacheStyle.backgroundImage;\n if(util.isString(backgroundImage)) {\n return true;\n }\n if(computedStyle.backgroundColor[3] > 0) {\n return true;\n }\n else if(backgroundImage && backgroundImage.k) {\n return true;\n }\n for(let list = ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[k + 'Width'] > 0 && computedStyle[k + 'Color'][3] > 0) {\n return true;\n }\n }\n let boxShadow = computedStyle.boxShadow;\n if(Array.isArray(boxShadow)) {\n for(let i = 0, len = boxShadow.length; i < len; i++) {\n let item = boxShadow[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n // borderRadius用5,只要有bgc或border就会超过\n for(let i = 0, len = borderRadiusKs.length; i < len; i++) {\n let v = computedStyle[borderRadiusKs[i]];\n if(v[0] > 0 && v[1] > 0) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param lv\n * @param ctx\n * @param defs\n */\n render(renderMode, lv, ctx, defs) {\n let {\n isDestroyed,\n currentStyle,\n computedStyle,\n __cacheStyle,\n root,\n __cache: cache,\n __cacheTotal: cacheTotal,\n } = this;\n // 渲染完认为完全无变更,等布局/动画/更新重置\n this.__refreshLevel = level.NONE;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明 level.NONE) {\n let { __sx: x, __sy: y, parent } = this;\n this.__calCache(renderMode, lv, ctx, defs, parent, __cacheStyle, currentStyle, computedStyle, x, y);\n let p;\n if(level.contain(lv, TRANSFORM_ALL)) {\n p = p || this.domParent;\n let matrix = __cacheStyle.matrix;\n if(p) {\n matrix = mx.multiply(p.matrixEvent, matrix);\n }\n this.__matrixEvent = matrix;\n }\n if(level.contain(lv, level.OPACITY)) {\n let opacity = computedStyle.opacity;\n p = p || this.domParent;\n if(p) {\n opacity *= p.__opacity;\n }\n this.__opacity = opacity;\n }\n if(level.contain(lv, level.FILTER) && Array.isArray(computedStyle.filter)) {\n computedStyle.filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n this.__blurValue = v;\n let bbox = this.bbox;\n if(cache) {\n this.__cache = Cache.updateCache(cache, bbox);\n }\n else {\n this.__cache = Cache.getInstance(bbox);\n }\n }\n });\n }\n if(computedStyle.visibility === 'hidden') {\n return { canCache: canCache || !this.visibilityAnimating };\n }\n }\n // 有cacheTotal省略判断有效动画\n return { canCache: canCache || !this.availableAnimating };\n }\n // 使用sx和sy渲染位置,考虑了relative和translate影响\n let {\n sx: x,\n sy: y,\n width,\n height,\n innerWidth,\n innerHeight,\n outerWidth,\n outerHeight,\n } = this;\n this.__sx = x;\n this.__sy = y;\n let {\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth,\n borderBottomWidth,\n } = computedStyle;\n let x1 = x + marginLeft;\n let x2 = x1 + borderLeftWidth;\n let x3 = x2 + width + paddingLeft + paddingRight;\n let x4 = x3 + borderRightWidth;\n let y1 = y + marginTop;\n let y2 = y1 + borderTopWidth;\n let y3 = y2 + height + paddingTop + paddingBottom;\n let y4 = y3 + borderBottomWidth;\n let res = { x1, x2, x3, x4, y1, y2, y3, y4 };\n // 防止cp直接返回cp嵌套,拿到真实dom的parent\n let p = this.domParent;\n // 计算好cacheStyle的内容,以及位图缓存指数\n let hasContent = this.__hasContent = this.__calCache(renderMode, lv, ctx, defs, this.parent,\n __cacheStyle, currentStyle, computedStyle,\n x, y, innerWidth, innerHeight, outerWidth, outerHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n x1, x2, x3, x4, y1, y2, y3, y4\n );\n let {\n backgroundColor,\n borderTopColor,\n borderRightColor,\n borderBottomColor,\n borderLeftColor,\n borderTopLeftRadius,\n borderTopRightRadius,\n borderBottomRightRadius,\n borderBottomLeftRadius,\n visibility,\n backgroundRepeat,\n backgroundImage,\n opacity,\n filter,\n backgroundSize,\n boxShadow,\n } = computedStyle;\n // 先设置透明度,canvas可以向上累积\n if(renderMode === mode.CANVAS) {\n if(p) {\n opacity *= p.__opacity;\n }\n this.__opacity = opacity;\n }\n else if(renderMode === mode.SVG) {\n if(opacity === 1) {\n delete virtualDom.opacity;\n }\n else {\n virtualDom.opacity = opacity;\n }\n }\n // canvas/svg/事件需要3种不同的matrix\n let matrix = __cacheStyle.matrix;\n let renderMatrix = this.__renderMatrix = matrix;\n // 变换对事件影响,canvas要设置渲染\n if(p) {\n matrix = mx.multiply(p.matrixEvent, matrix);\n }\n this.__matrixEvent = matrix;\n if(renderMode === mode.SVG) {\n // svg可以没变化省略计算,因为只相对于自身\n if(!level.contain(lv, TRANSFORM_ALL) && lv < level.REPAINT) {}\n else if(!equalArr(renderMatrix, [1, 0, 0, 1, 0, 0])) {\n virtualDom.transform = 'matrix(' + joinArr(renderMatrix, ',') + ')';\n }\n else {\n delete virtualDom.transform;\n }\n }\n // 隐藏不渲染,依然注意canCache在canvas/svg下意义不同\n if(visibility === 'hidden') {\n if(renderMode === mode.CANVAS) {\n return { ...res, break: true, canCache: !this.visibilityAnimating };\n }\n }\n if(renderMode === mode.SVG) {\n virtualDom.visibility = visibility;\n }\n // 无内容或者无影响动画视为可缓存本身\n let canCache = !hasContent || !this.availableAnimating;\n // 无缓存重新渲染时是否使用缓存\n let dx = 0, dy = 0;\n if(root.cache && renderMode === mode.CANVAS) {\n // 置空防止原型链查找性能\n this.__cache = this.__cacheTotal = this.__cacheFilter = this.__cacheMask = null;\n let isGeom = this.tagName.charAt(0) === '$';\n let isImg = this.tagName.toLowerCase() === 'img';\n // 无内容可释放并提前跳出,geom特殊判断,因为后面子类会绘制矢量,img也特殊判断\n if(!hasContent) {\n if(!isGeom && cache && cache.available) {\n cache.release();\n }\n // 无内容且lv变化小geom可以提前跳出,普通dom直接跳出\n if(lv < level.REPAINT && isGeom) {\n return { ...res, break: true, canCache };\n }\n if(!isImg) {\n return { ...res, canCache };\n }\n }\n // 有缓存情况快速使用位图缓存不再继续,filter要更新bbox范围,排除geom,因为是整屏\n if(cache && cache.available && lv < level.REPAINT) {\n if(level.contain(lv, level.FILTER)) {\n cache = this.__cache = Cache.updateCache(cache, this.bbox);\n }\n return { ...res, break: true, canCache, cache };\n }\n // 新生成根据最大尺寸,排除margin从border开始还要考虑阴影滤镜等,geom单独在dom里做\n if((!cache || !cache.available)) {\n let bbox = this.bbox;\n if(cache) {\n cache.reset(bbox);\n }\n else {\n cache = Cache.getInstance(bbox);\n }\n // 有可能超过最大尺寸限制不使用缓存\n if(cache && cache.enabled) {\n this.__cache = cache;\n cache.__bbox = bbox;\n cache.__appendData(x1, y1);\n let dbx = cache.dbx, dby = cache.dby;\n ctx = cache.ctx;\n let [xc, yc] = cache.coords;\n dx = cache.dx;\n dy = cache.dy;\n // 重置ctx为cache的,以及绘制坐标为cache的区域\n res.x1 = x1 = xc + dbx;\n res.y1 = y1 = yc + dby;\n if(dx) {\n res.x2 = x2 += dx;\n res.x3 = x3 += dx;\n res.x4 = x4 += dx;\n }\n if(dy) {\n res.y2 = y2 += dy;\n res.y3 = y3 += dy;\n res.y4 = y4 += dy;\n }\n }\n // 更新后可能超了需释放\n else if(this.__cache) {\n this.__cache.release();\n this.__cache = null;\n }\n }\n // 无离屏功能视为不可缓存本身\n if(!cache) {\n canCache = false;\n }\n }\n // 无cache时canvas的blur需绘制到离屏上应用后反向绘制回来,有cache在Dom里另生成一个filter的cache\n let offScreen;\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n this.__blurValue = v;\n // geom由dom看管,做了替换工作,以便自定义geom时render()不感知离屏过程\n if(renderMode === mode.CANVAS && v > 0 && (!cache || !cache.enabled) && this.tagName.charAt(0) !== '$') {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$blur$$__');\n if(c.ctx) {\n offScreen = {\n ctx,\n blur: v,\n };\n offScreen.target = c;\n ctx = c.ctx;\n }\n }\n else if(renderMode === mode.SVG\n && (lv >= level.REFLOW || level.contain(lv, level.FILTER))) {\n // 模糊框卷积尺寸 #66\n if(v > 0) {\n let d = mx.int2convolution(v);\n let id = defs.add({\n tagName: 'filter',\n props: [\n ['x', -d / outerWidth],\n ['y', -d / outerHeight],\n ['width', 1 + d * 2 / outerWidth],\n ['height', 1 + d * 2 / outerHeight],\n ],\n children: [\n {\n tagName: 'feGaussianBlur',\n props: [\n ['stdDeviation', v],\n ],\n }\n ],\n });\n virtualDom.filter = 'url(#' + id + ')';\n }\n else {\n delete virtualDom.filter;\n }\n }\n }\n });\n }\n if(virtualDom && virtualDom.filter && this.__blurValue <= 0) {\n delete virtualDom.filter;\n }\n // svg在非首次有vd缓存的情况下,本次绘制 0) {\n renderBgc(renderMode, __cacheStyle.backgroundColor, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n if(util.isString(backgroundImage)) {\n let loadBgi = this.__loadBgi;\n if(loadBgi.url === backgroundImage) {\n let source = loadBgi.source;\n // 无source不绘制\n if(source) {\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize;\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > innerWidth && height > innerHeight) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w >= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(width > innerWidth) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(height > innerHeight) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(innerWidth > width && innerHeight > height) {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n else if(innerWidth > width) {\n w = innerWidth;\n h = w * height / width;\n }\n else if(innerHeight > height) {\n h = innerHeight;\n w = h * width / height;\n }\n else {\n w = width / innerWidth;\n h = height / innerHeight;\n if(w <= h) {\n w = innerWidth;\n h = w * height / width;\n }\n else {\n h = innerHeight;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = x2 + calBackgroundPosition(currentStyle.backgroundPositionX, innerWidth, w);\n let bgY = y2 + calBackgroundPosition(currentStyle.backgroundPositionY, innerHeight, h);\n // 超出尺寸模拟mask截取\n let needMask = bgX < x2 || bgY < y2 || w > innerWidth || h > innerHeight;\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgX - x2;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = x2 + innerWidth - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeat'].indexOf(backgroundRepeat) > -1) {\n let diff = bgY - y2;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = y2 + innerHeight - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < x2) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > x2 + innerWidth) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < y2) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > y2 + innerHeight) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS) {\n if(needMask) {\n ctx.save();\n renderBgc(renderMode, '#FFF', x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, innerWidth, innerHeight);\n let props = [\n ['xlink:href', backgroundImage],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height]\n ];\n let needResize;\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(matrix, ',') + ')']);\n }\n if(needMask) {\n let id = defs.add({\n tagName: 'clipPath',\n children: [{\n tagName: 'rect',\n props: [\n ['x', x2],\n ['y', y2],\n ['width', innerWidth],\n ['height', innerHeight],\n ['fill', '#FFF']\n ],\n }],\n });\n this.virtualDom.bbClip = 'url(#' + id + ')';\n }\n // 先画不考虑repeat的中心声明的\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], innerWidth, innerHeight);\n if(matrix && !equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n copy[5][1] = 'matrix(' + joinArr(matrix, ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n this.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n }\n else if(backgroundImage.k) {\n renderBgc(renderMode, __cacheStyle.backgroundImage, x2, y2, innerWidth, innerHeight, ctx, this,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n }\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n renderBoxShadow(renderMode, ctx, defs, item, this, x1, y1, x2, y2, x3, y3, x4, y4, outerWidth, outerHeight);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderTop, __cacheStyle.borderTopColor, ctx, this, dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderRight, __cacheStyle.borderRightColor, ctx, this, dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderBottom, __cacheStyle.borderBottomColor, ctx, this, dx, dy);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n renderBorder(renderMode, __cacheStyle.borderLeft, __cacheStyle.borderLeftColor, ctx, this, dx, dy);\n }\n if(cache && cache.enabled) {\n cache.__available = true;\n }\n if(renderMode === mode.CANVAS) {\n return { ...res, canCache, cache, offScreen };\n }\n // svg前面提前跳出,到这一定是>=REPAINT的变化\n else if(renderMode === mode.SVG) {\n return { canCache: false };\n }\n }\n\n __renderByMask(renderMode, lv, ctx, defs) {\n let { next, root, __hasMask, __hasClip } = this;\n if(__hasMask === undefined || __hasClip === undefined) {\n __hasMask = this.__hasMask = !!(next && next.isMask);\n __hasClip = this.__hasClip = !!(next && next.isClip);\n }\n // cache情况特殊处理,geom照常绘制,交由dom处理mask\n if((root.cache && renderMode === mode.CANVAS) || (!__hasMask && !__hasClip)) {\n return this.render(renderMode, lv, ctx, defs);\n }\n if(renderMode === mode.CANVAS) {\n let res;\n // canvas借用2个离屏canvas来处理,c绘制本xom,m绘制多个mask\n if(__hasMask) {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$mask1$$__');\n res = this.render(renderMode, lv, c.ctx);\n // 收集之前的mask列表\n let list = [];\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n // 当mask只有1个时,无需生成m,直接在c上即可\n if(list.length === 1) {\n next = list[0];\n c.ctx.globalCompositeOperation = 'destination-in';\n next.render(renderMode, lv, c.ctx, null);\n // 为小程序特殊提供的draw回调,每次绘制调用都在攒缓冲,drawImage另一个canvas时刷新缓冲,需在此时主动flush\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n }\n // 多个借用m绘制mask,用c结合mask获取结果,最终结果再到当前画布\n else {\n let m = inject.getCacheCanvas(width, height, '__$$mask2$$__');\n list.forEach(item => {\n item.render(renderMode, lv, m.ctx, null, true);\n });\n m.draw(m.ctx);\n c.ctx.globalCompositeOperation = 'destination-in';\n c.ctx.drawImage(m.canvas, 0, 0);\n c.draw(c.ctx);\n ctx.drawImage(c.canvas, 0, 0);\n c.draw(ctx);\n // 清除\n m.ctx.globalCompositeOperation = 'source-over';\n m.ctx.clearRect(0, 0, width, height);\n m.draw(m.ctx);\n }\n ctx.restore();\n // 清除\n c.ctx.globalCompositeOperation = 'source-over';\n c.ctx.clearRect(0, 0, width, height);\n c.draw(c.ctx);\n }\n // 劫持canvas原生方法使得多个clip矢量连续绘制\n else if(__hasClip) {\n ctx.save();\n ctx.beginPath();\n let fill = ctx.fill;\n let beginPath = ctx.beginPath;\n let closePath = ctx.closePath;\n ctx.fill = ctx.beginPath = ctx.closePath = empty;\n while(next && next.isClip) {\n next.render(renderMode, lv, ctx);\n next = next.next;\n }\n ctx.fill = fill;\n ctx.beginPath = beginPath;\n ctx.closePath = closePath;\n ctx.clip();\n ctx.closePath();\n res = this.render(renderMode, lv, ctx);\n ctx.restore();\n }\n return res;\n }\n else if(renderMode === mode.SVG) {\n let res = this.render(renderMode, lv, ctx, defs);\n // 检查后续mask是否是空,空遮罩不生效\n let isEmpty = true;\n let sibling = next;\n outer:\n while(sibling) {\n let { children } = sibling.virtualDom;\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n for(let j = 0, len = props.length; j < len; j++) {\n let [k, v] = props[i];\n if(k === 'd') {\n if(v) {\n isEmpty = false;\n break outer;\n }\n }\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(__hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(__hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n if(isEmpty || this.computedStyle.display === 'none') {\n return res;\n }\n // 应用mask本身的matrix,以及被遮罩对象的matrix逆\n sibling = next;\n let mChildren = [];\n while(sibling) {\n let { computedStyle: { display, visibility } } = sibling;\n if(display !== 'none' && visibility !== 'hidden') {\n let { children } = sibling.virtualDom;\n mChildren = mChildren.concat(children);\n for(let i = 0, len = children.length; i < len; i++) {\n let { tagName, props } = children[i];\n if(tagName === 'path') {\n let matrix = sibling.__renderMatrix;\n let inverse = mx.inverse(this.__renderMatrix);\n matrix = mx.multiply(matrix, inverse);\n // transform属性放在最后一个省去循环\n let len = props.length;\n if(!len || props[len - 1][0] !== 'transform') {\n props.push(['transform', `matrix(${matrix})`]);\n }\n else {\n props[len - 1][1] = `matrix(${matrix})`;\n }\n }\n }\n }\n sibling = sibling.next;\n if(!sibling) {\n break;\n }\n if(__hasMask) {\n if(!sibling.isMask) {\n break;\n }\n }\n else if(__hasClip) {\n if(!sibling.isClip) {\n break;\n }\n }\n }\n let id = defs.add({\n tagName: __hasClip ? 'clipPath' : 'mask',\n props: [],\n children: mChildren,\n });\n id = 'url(#' + id + ')';\n // 作为mask会在defs生成maskId供使用,多个连续mask共用一个id\n if(__hasMask) {\n this.virtualDom.mask = id;\n }\n else if(__hasClip) {\n this.virtualDom.clip = id;\n }\n return res;\n }\n }\n\n __applyCache(renderMode, ctx, tx, ty) {\n let cache = this.__cache;\n if(cache && cache.available) {\n let { coords, canvas, size, dbx, dby } = cache;\n let [x, y] = coords;\n ctx.drawImage(canvas, x - 1, y - 1, size, size, tx - dbx, ty - dby, size, size);\n }\n }\n\n // 简化bbox为2个坐标点形式,并附带matrix计算\n __mergeBbox(matrix, isTop, dx, dy) {\n // 空内容\n let bbox;\n if(this.__cache && this.__cache.available) {\n bbox = this.__cache.bbox.slice(0);\n }\n else {\n bbox = this.bbox;\n }\n if(!isTop) {\n bbox = util.transformBbox(bbox, matrix, dx, dy);\n }\n return bbox;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n let ref = this.props.ref;\n if(ref) {\n let owner = this.host || this.root;\n if(owner && owner.ref[ref]) {\n delete owner.ref[ref];\n }\n }\n this.animationList.forEach(item => item.__destroy());\n this.root.delRefreshTask(this.__loadBgi.cb);\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__matrix = this.__matrixEvent = this.__root = null;\n if(this.__cache) {\n this.__cache.release();\n this.__cache = null;\n }\n if(this.__cacheTotal) {\n this.__cacheTotal.release();\n this.__cacheTotal = null;\n }\n if(this.__cacheFilter) {\n this.__cacheFilter.release();\n this.__cacheFilter = null;\n }\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n e.target = this;\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e) {\n let { x, y } = e;\n let { sx, sy, outerWidth, outerHeight, matrixEvent,\n computedStyle: { pointerEvents } } = this;\n if(pointerEvents === 'none') {\n return;\n }\n let inThis = tf.pointInQuadrilateral(\n x, y,\n sx, sy,\n sx + outerWidth, sy,\n sx + outerWidth, sy + outerHeight,\n sx, sy + outerHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root.__touchstartTarget = this;\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, defs, x2, y2, x3, y3, iw, ih, vs) {\n let { k, v, d, s, z, p } = vs;\n let cx = x2 + iw * 0.5;\n let cy = y2 + ih * 0.5;\n let res;\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, cx, cy, iw, ih);\n res = this.__getLg(renderMode, ctx, defs, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, x2, y2, x3, y3);\n res = this.__getRg(renderMode, ctx, defs, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, defs, gd) {\n if(renderMode === mode.CANVAS) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], item[0]);\n });\n return lg;\n }\n else if(renderMode === mode.SVG) {\n let uuid = defs.add({\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2]\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', item[0]],\n ['offset', item[1] * 100 + '%']\n ],\n };\n }),\n });\n return 'url(#' + uuid + ')';\n }\n }\n\n // canvas清空自身cache,cacheTotal在Root的自底向上逻辑做,svg仅有cacheTotal\n __cancelCache() {\n this.__cacheStyle = {};\n if(this.__cache) {\n this.__cache.release();\n }\n if(this.__cacheTotal) {\n this.__cacheTotal.release();\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 updateStyle(style, cb) {\n let { tagName, root, props, style: os } = this;\n if(root) {\n let hasChange;\n // 先去掉缩写\n let ks = Object.keys(style);\n ks.forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(style, k);\n delete style[k];\n }\n });\n // 此处仅检测样式是否有效\n for(let i in style) {\n if(style.hasOwnProperty(i)) {\n // 是规定内的合法样式\n if(change.isValid(tagName, i)) {\n if(change.isGeom(tagName, i)) {\n if(!css.equalStyle(i, style[i], props[i], this)) {\n hasChange = true;\n }\n }\n else if(!css.equalStyle(i, style[i], os[i], this)) {\n hasChange = true;\n }\n }\n else {\n delete style[i];\n }\n }\n }\n // 空样式或非法或无改变直接返回\n if(!hasChange) {\n if(util.isFunction(cb)) {\n cb(0);\n }\n return;\n }\n let node = this;\n root.addRefreshTask(node.__task = {\n before() {\n if(node.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node,\n style,\n origin: true, // 标识样式未经过normalize,不同于animate\n overwrite: true, // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n });\n },\n after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n }\n\n animate(list, options) {\n if(this.isDestroyed) {\n return;\n }\n let animation = new Animation(this, list, options);\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n css.computeMeasure(this, isHost);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n deepScan(cb, options) {\n return cb(this, options);\n }\n\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.layoutData.x += diff;\n }\n if(lv !== undefined) {\n this.__refreshLevel |= lv;\n }\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.layoutData.y += diff;\n }\n if(lv !== undefined) {\n this.__refreshLevel |= lv;\n }\n }\n\n __resizeX(diff) {\n this.computedStyle.width = this.__width += diff;\n this.layoutData.w += diff;\n }\n\n __resizeY(diff) {\n this.computedStyle.height = this.__height += diff;\n this.layoutData.h += diff;\n }\n\n __spreadByBoxShadowAndFilter(boxShadow, filter) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, blur, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = mx.int2convolution(blur);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n if(Array.isArray(filter)) {\n for(let i = 0, len = filter.length; i < len; i++) {\n let [k, v] = filter[i];\n if(k === 'blur') {\n let d = mx.int2convolution(v);\n ox = Math.max(ox, d);\n oy = Math.max(oy, d);\n }\n }\n }\n return [ox, oy];\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get innerWidth() {\n let {\n computedStyle: {\n display,\n paddingRight,\n paddingLeft,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.width\n + paddingLeft\n + paddingRight;\n }\n\n get innerHeight() {\n let {\n computedStyle: {\n display,\n paddingTop,\n paddingBottom,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.height\n + paddingTop\n + paddingBottom;\n }\n\n get outerWidth() {\n let {\n computedStyle: {\n display,\n borderLeftWidth,\n borderRightWidth,\n marginRight,\n marginLeft,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerWidth\n + borderLeftWidth\n + borderRightWidth\n + marginLeft\n + marginRight;\n }\n\n get outerHeight() {\n let {\n computedStyle: {\n display,\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n },\n } = this;\n if(display === 'none') {\n return 0;\n }\n return this.innerHeight\n + borderTopWidth\n + borderBottomWidth\n + marginTop\n + marginBottom;\n }\n\n // 不考虑margin的范围\n get bbox() {\n let {\n sx, sy, width, height,\n computedStyle: {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n boxShadow,\n filter,\n },\n } = this;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n sx += marginLeft;\n sy += marginTop;\n width += borderLeftWidth + paddingLeft + borderRightWidth + paddingRight;\n height += borderTopWidth + paddingTop + borderBottomWidth + paddingBottom;\n return [sx - ox, sy - oy, sx + width + ox, sy + height + oy];\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 renderMatrix() {\n return this.__renderMatrix;\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 // 除IGNORE外的动画为有效的\n get availableAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n if(!change.isIgnore(transition[i].k)) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n // 除IGNORE/opacity/transform/filter/visibility外的动画为有影响的\n get effectiveAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n let k = transition[i].k;\n if(!change.isIgnore(k) || level.TRANSFORMS.hasOwnProperty(k)\n || k === 'opacity' || k === 'transform' || k === 'filter' || k === 'visibility') {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n // 是否有display的动画,在none时执行其它的都可视为无效,影响缓存\n get displayAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n let k = transition[i].k;\n if(k === 'display') {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n // 是否有visibility的动画,在为hidden时执行其它的都可视为无效,影响缓存\n get visibilityAnimating() {\n let list = this.animationList;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.animating && item.currentFrame) {\n let { transition } = item.currentFrame;\n for(let i = 0, len = transition.length; i < len; i++) {\n let k = transition[i].k;\n if(k === 'visibility') {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get layoutData() {\n return this.__layoutData;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n}\n\nexport default Xom;\n","class LineGroup {\n constructor(x, y) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__baseLine = 0;\n }\n\n add(item) {\n this.list.push(item);\n }\n\n __calBaseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return baseLine;\n }\n\n verticalAlign() {\n let n = this.__baseLine = this.__calBaseLine();\n // 仅当有2个和以上时才需要vertical对齐调整\n if(this.list.length > 1) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n horizonAlign(diff) {\n this.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n\n get list() {\n return this.__list;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n let width = 0;\n this.list.forEach(item => {\n width += item.outerWidth;\n });\n return width;\n }\n\n get height() {\n let height = 0;\n this.list.forEach(item => {\n height = Math.max(height, item.outerHeight);\n });\n return height;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get marginBottom() {\n let n = 0;\n this.list.forEach(item => {\n n = Math.max(n, item.computedStyle.marginBottom);\n });\n return n;\n }\n}\n\nexport default LineGroup;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import Text from '../node/Text';\nimport tag from '../node/tag';\nimport util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flattenJson({\n children: cd,\n $$type: TYPE_VD,\n });\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\n\nfunction initCp(json, root, owner) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n let vd = build(json, root, owner, owner);\n if(Array.isArray(vd)) {\n relation(owner, vd);\n }\n return vd;\n }\n else {\n return new Text(json);\n }\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param owner\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, owner, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, owner, host));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, inherit, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.placeholder) {\n return json.value;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, owner, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = vd.__tagName || tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用\n json.vd = vd;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = vd;\n });\n }\n // 更新过程中key相同的vd继承动画\n if(inherit) {\n util.extendAnimate(inherit, vd);\n }\n vd.__root = root;\n if(host) {\n vd.__host = host;\n }\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n owner.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children.children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n if(children instanceof Dom) {\n relation(children, children.children);\n }\n // 文字视作为父节点的直接文字子节点\n else if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initCp,\n flattenJson,\n relation,\n build,\n};\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.__state = {};\n this.__isMounted = false;\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n cb.call(self);\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n root.delRefreshTask(self.__task);\n this.__task = {\n before: () => {\n // 标识更新\n self.__nextState = n;\n setUpdateFlag(this);\n },\n after: () => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n __state: true, // 特殊标识来源让root刷新时识别\n };\n root.addRefreshTask(self.__task);\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.__state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n let root = this.root;\n let cd = json || builder.flattenJson(this.render());\n let sr = builder.initCp(cd, root, this, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n console.warn('Component render() return a text, should not inherit style/event');\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr,以及自定义事件\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n }\n else if(sr instanceof Component) {\n // 本身build是递归的,子cp已经初始化了\n console.warn('Component render() return a component: '\n + this.tagName + ' -> ' + sr.tagName\n + ', should not inherit style/event');\n }\n else {\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // shadow指向直接root,shadowRoot考虑到返回Component的递归\n this.__shadow = sr;\n sr.__host = this;\n while(sr instanceof Component) {\n sr = sr.shadowRoot;\n }\n sr.__host = this;\n this.__shadowRoot = sr;\n if(!this.__isMounted) {\n this.__isMounted = true;\n let { componentDidMount } = this;\n if(isFunction(componentDidMount)) {\n root.once(Event.REFRESH, () => {\n componentDidMount.call(this);\n });\n }\n }\n }\n\n render() {\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n let { componentWillUnmount } = this;\n if(isFunction(componentWillUnmount)) {\n componentWillUnmount.call(this);\n this.__isMounted = false;\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__shadow = null;\n this.__shadowRoot = null;\n this.__parent = null;\n }\n\n __emitEvent(e) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n __computeMeasure(renderMode, ctx, isHost, cb) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n sr.__computeMeasure(renderMode, ctx);\n }\n // 其它类型为Xom或Component\n else {\n sr.__computeMeasure(renderMode, ctx, true, cb);\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\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 prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'innerWidth',\n 'innerHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n 'layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n '__refreshLevel',\n '__cacheTotal',\n '__cache',\n 'bbox',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'deepScan',\n '__cancelCache',\n '__applyCache',\n '__mergeBbox',\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","export default {\n ROOT: 0, // 普通主屏递归渲染\n TOP: 1, // 局部根节点离屏汇总渲染\n CHILD: 2, // 局部根节点的子节点汇总渲染\n};\n","import Xom from '../node/Xom';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport level from '../refresh/level';\nimport refreshMode from '../refresh/mode';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport Cache from '../refresh/Cache';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { int2rgba, isNil } = util;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__isMask = !!this.props.mask;\n this.__isClip = !!this.props.clip;\n let { style, isMask, isClip } = this;\n if(isMask || isClip) {\n style.visibility = 'visible';\n style.background = null;\n style.border = null;\n style.strokeWidth = 0;\n style.stroke = null;\n if(isClip) {\n style.fill = '#FFF';\n style.opacity = 1;\n }\n }\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n this.__cacheProps = {};\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n return w;\n }\n\n __calAutoBasis(isDirectionRow) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n } = currentStyle;\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit !== AUTO) {\n b = max += main.value;\n }\n // border也得计算在内\n if(isDirectionRow) {\n let w = borderRightWidth + borderLeftWidth;\n b += w;\n max += w;\n min += w;\n }\n else {\n let h = borderTopWidth + borderBottomWidth;\n b += h;\n max += h;\n min += h;\n }\n return { b, min, max };\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__marginAuto(this.currentStyle, data);\n this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n this.__width = fixedWidth ? w : x - data.x;\n this.__height = fixedHeight ? h : y - data.y;\n this.__cacheProps = {};\n }\n\n __preSet(renderMode, ctx, defs) {\n let { sx: x, sy: y, width, height, __cacheStyle, currentStyle, computedStyle } = this;\n let {\n borderTopWidth,\n borderLeftWidth,\n display,\n marginTop,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n visibility,\n } = computedStyle;\n let originX = x + borderLeftWidth + marginLeft + paddingLeft;\n let originY = y + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n let iw = width + paddingLeft + paddingRight;\n let ih = height + paddingTop + paddingBottom;\n // 先根据cache计算需要重新计算的computedStyle\n ['stroke', 'fill'].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n if(v && (v.k === 'linear' || v.k === 'radial')) {\n __cacheStyle[k] = this.__gradient(renderMode, ctx, defs, originX, originY, originX + width, originY + height, iw, ih, v);\n }\n else {\n __cacheStyle[k] = int2rgba(currentStyle[k]);\n }\n }\n });\n if(isNil(__cacheStyle.strokeWidth)) {\n __cacheStyle.strokeWidth = true;\n let strokeWidth = currentStyle.strokeWidth;\n if(strokeWidth.unit === PX) {\n computedStyle.strokeWidth = strokeWidth.value;\n }\n else if(strokeWidth.unit === PERCENT) {\n computedStyle.strokeWidth = strokeWidth.value * width * 0.01;\n }\n else {\n computedStyle.strokeWidth = 0;\n }\n }\n if(isNil(__cacheStyle.strokeDasharray)) {\n __cacheStyle.strokeDasharray = true;\n computedStyle.strokeDasharray = currentStyle.strokeDasharray;\n __cacheStyle.strokeDasharrayStr = util.joinArr(currentStyle.strokeDasharray, ',');\n }\n // 直接赋值的\n [\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let {\n fill,\n stroke,\n strokeDasharrayStr,\n } = __cacheStyle;\n let {\n strokeWidth,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n strokeDasharray,\n fillRule,\n } = computedStyle;\n return {\n x,\n y,\n originX,\n originY,\n cx,\n cy,\n display,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n visibility,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS) {\n if(ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n if(ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(!util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n let cacheFilter = this.__cacheFilter, cacheTotal = this.__cacheTotal, cache = this.__cache;\n let virtualDom = this.virtualDom;\n // 存在老的缓存认为可提前跳出\n if(lv < level.REPAINT\n && (cacheTotal && cacheTotal.available || cache && cache.available || !level.contain(lv, level.FILTER) && cacheFilter)) {\n res.break = true; // geom子类标识可以跳过自定义render()\n }\n if(renderMode === mode.SVG) {\n // svg mock,每次都生成,每个节点都是局部根,更新时自底向上清除\n if(!cacheTotal) {\n this.__cacheTotal = {\n available: true,\n release() {\n this.available = false;\n delete virtualDom.cache;\n },\n };\n }\n else if(!cacheTotal.available) {\n cacheTotal.available = true;\n }\n this.virtualDom.type = 'geom';\n }\n // 无论canvas/svg,break可提前跳出省略计算\n if(res.break) {\n return res;\n }\n this.__cacheFilter = null;\n // data在无cache时没有提前设置\n let preData = (this.root.cache && renderMode === mode.CANVAS) ? this.__preData : this.__preSet(renderMode, ctx, defs);\n let { x2, y2 } = res;\n let { originX, originY } = preData;\n // 有cache时需计算差值\n let { paddingLeft, paddingTop } = this.computedStyle;\n x2 += paddingLeft;\n y2 += paddingTop;\n preData.dx = x2 - originX;\n preData.dy = y2 - originY;\n this.__preSetCanvas(renderMode, ctx, preData);\n return Object.assign(res, preData);\n }\n\n __renderAsMask(renderMode, lv, ctx, defs, isClip) {\n if(renderMode === mode.CANVAS) {\n this.root.cache && (this.__preData = this.__preSet(renderMode, ctx, defs));\n }\n // mask渲染在canvas等被遮罩层调用,svg生成maskId\n else if(renderMode === mode.SVG) {\n this.render(renderMode, lv, ctx, defs);\n let vd = this.virtualDom;\n if(isClip) {\n vd.isClip = true;\n }\n else {\n vd.isMask = true;\n }\n // 强制不缓存,防止引用mask的matrix变化不生效\n delete vd.lv;\n }\n }\n\n // 类似dom,但geom没有children所以没有total的概念\n __applyCache(renderMode, lv, ctx, mode, cacheTop, opacity, matrix) {\n let cacheFilter = this.__cacheFilter;\n let cacheMask = this.__cacheMask;\n let cache = this.__cache;\n let computedStyle = this.computedStyle;\n // 优先filter,然后mask,再cache\n let target = cacheFilter || cacheMask;\n // 向总的离屏canvas绘制,最后由top汇总再绘入主画布\n if(mode === refreshMode.CHILD) {\n let { sx: x, sy: y } = this;\n x += computedStyle.marginLeft;\n y += computedStyle.marginTop;\n let { coords: [tx, ty], x1, y1, dbx, dby } = cacheTop;\n let dx = tx + x - x1 + dbx;\n let dy = ty + y - y1 + dby;\n let tfo = computedStyle.transformOrigin.slice(0);\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n matrix = mx.multiply(matrix, m);\n ctx.setTransform(...matrix);\n opacity *= computedStyle.opacity;\n ctx.globalAlpha = opacity;\n if(target) {\n Cache.drawCache(target, cacheTop);\n }\n else if(cache && cache.available) {\n Cache.drawCache(cache, cacheTop);\n }\n }\n // root调用局部整体缓存或单个节点缓存绘入主画布\n else if(mode === refreshMode.ROOT) {\n let { __opacity, matrixEvent } = this;\n // 写回主画布前设置\n ctx.globalAlpha = __opacity;\n ctx.setTransform(...matrixEvent);\n if(target) {\n let { x1, y1, dbx, dby, canvas } = target;\n ctx.drawImage(canvas, x1 - 1 - dbx, y1 - 1 - dby);\n }\n else if(cache && cache.available) {\n let { coords: [tx, ty], x1, y1, dbx, dby, canvas, size } = cache;\n ctx.drawImage(canvas, tx - 1, ty - 1, size, size, x1 - 1 - dbx, y1 - 1 - dby, size, size);\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n __cancelCache(recursion) {\n super.__cancelCache(recursion);\n this.__cacheProps = {};\n }\n\n // geom强制有内容\n __calCache() {\n super.__calCache.apply(this, arguments);\n return true;\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n get baseLine() {\n return this.__height;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static getRegister(name) {\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return REGISTER.hasOwnProperty(name);\n }\n}\n\nexport default Geom;\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineGroup from './LineGroup';\nimport Component from './Component';\nimport Geom from '../geom/Geom';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport blur from '../style/blur';\nimport tf from '../style/transform';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport level from '../refresh/level';\nimport Cache from '../refresh/Cache';\nimport refreshMode from '../refresh/mode';\nimport mx from '../math/matrix';\n\nconst { AUTO, PX, PERCENT } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nfunction genZIndexChildren(dom) {\n let flow = [];\n let abs = [];\n let needSort = false;\n let lastIndex;\n dom.children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 不是遮罩,并且已有computedStyle,特殊情况下中途插入的节点还未渲染\n if(!item.isMask && !item.isClip && item.computedStyle) {\n if(item instanceof Xom) {\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__iIndex = i;\n let z = child.__zIndex = item.currentStyle.zIndex;\n abs.push(child);\n if(lastIndex === undefined) {\n lastIndex = z;\n }\n else if(!needSort) {\n if(z < lastIndex) {\n needSort = true;\n }\n lastIndex = z;\n }\n }\n else {\n flow.push(child);\n }\n }\n else {\n flow.push(child);\n }\n }\n });\n needSort && abs.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n return a.__iIndex - b.__iIndex;\n });\n return flow.concat(abs);\n}\n\nfunction getMaskChildren(dom) {\n let list = [];\n dom.children.forEach(item => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item.isMask || item.isClip) {\n list.push(child);\n }\n });\n return list;\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(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style.fontWeight && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n }\n\n // 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: { width } } = this;\n if(width.unit === PX) {\n return w - width.value;\n }\n else if(width.unit === PERCENT) {\n return w - total * width.value * 0.01;\n }\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Xom || item instanceof Component) {\n w -= item.__tryLayInline(w, total);\n }\n else {\n w -= item.textWidth;\n }\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n __calAutoBasis(isDirectionRow, w, h, isRecursion) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n // 计算需考虑style的属性\n let {\n width,\n height,\n marginLeft,\n marginTop,\n marginRight,\n marginBottom,\n paddingLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n if(main.unit === PX) {\n b = max = main.value;\n // 递归时children的长度会影响flex元素的最小宽度\n if(isRecursion) {\n min = b;\n }\n }\n // 递归children取最大值\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { b: b2, min: min2, max: max2 } = item.__calAutoBasis(isDirectionRow, w, h, true);\n b = Math.max(b, b2);\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n // 文本水平\n else if(isDirectionRow) {\n min = Math.max(item.charWidth, min);\n max = Math.max(item.textWidth, max);\n }\n // 文本垂直\n else {\n css.computeReflow(item);\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n // margin/padding/border也得计算在内,此时还没有,百分比相对于父flex元素的宽度\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth.value + borderRightWidth.value + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth.value + borderBottomWidth.value + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return { b, min, max };\n }\n\n // 换算margin/padding为px单位\n __calMp(v, w) {\n let n = 0;\n if(v.unit === PX) {\n n += v.value;\n }\n else if(v.unit === PERCENT) {\n v.value *= w * 0.01;\n v.unit = PX;\n n += v.value;\n }\n return n;\n }\n\n // 本身block布局时计算好所有子元素的基本位置\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, lineGroups } = this;\n lineGroups.splice(0);\n let {\n textAlign,\n } = computedStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 递归布局,将inline的节点组成lineGroup一行\n let lineGroup = new LineGroup(x, y);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(item.currentStyle.display === 'inline') {\n // inline开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.outerWidth;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x, w);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.outerWidth;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.outerWidth;\n }\n }\n }\n else {\n // block/flex先处理之前可能的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n y += lineGroup.height + lineGroup.marginBottom;\n lineGroup = new LineGroup(data.x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n x = data.x;\n y += item.outerHeight;\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n }\n }\n // 文字和inline类似\n else {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x) {\n lineGroup.add(item);\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n x += item.width;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= 0) {\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n }\n // 放不下处理之前的lineGroup,并重新开头\n else {\n lineGroups.push(lineGroup);\n lineGroup.verticalAlign();\n x = data.x;\n y += lineGroup.height + lineGroup.marginBottom;\n item.__layout({\n x: data.x,\n y,\n w,\n h,\n }, isVirtual);\n lineGroup = new LineGroup(x, y);\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n x += item.width;\n lineGroup.add(item);\n if(isVirtual) {\n cw += item.width;\n }\n }\n }\n });\n // 结束后处理可能遗留的最后的lineGroup\n if(lineGroup.size) {\n lineGroups.push(lineGroup);\n // flex/abs的虚拟前置布局,无需真正计算\n if(!isVirtual) {\n lineGroup.verticalAlign();\n }\n else {\n maxW = Math.max(maxW, cw);\n }\n y += lineGroup.height;\n }\n this.__width = fixedWidth || !isVirtual ? w : maxW;\n this.__height = fixedHeight ? h : y - data.y;\n if(lineGroup.size) {\n y += lineGroup.marginBottom;\n }\n // text-align\n if(!isVirtual && ['center', 'right'].indexOf(textAlign) > -1) {\n lineGroups.forEach(lineGroup => {\n let diff = w - lineGroup.width;\n if(diff > 0) {\n lineGroup.horizonAlign(textAlign === 'center' ? diff * 0.5 : diff);\n }\n });\n }\n if(!isVirtual) {\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle } = this;\n let {\n flexDirection,\n justifyContent,\n alignItems,\n } = currentStyle;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n return;\n }\n let maxX = 0;\n let isDirectionRow = flexDirection === 'row';\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let minList = [];\n let growSum = 0;\n let shrinkSum = 0;\n let basisSum = 0;\n let maxSum = 0;\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n // abs虚拟布局计算时纵向也是看横向宽度\n let { b, min, max } = item.__calAutoBasis(isVirtual ? true : isDirectionRow, w, h);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { currentStyle, computedStyle } = item;\n let { flexGrow, flexShrink, flexBasis } = currentStyle;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n growSum += flexGrow;\n shrinkSum += flexShrink;\n // 根据basis不同,计算方式不同\n if(flexBasis.unit === AUTO) {\n basisList.push(max);\n basisSum += max;\n }\n else if(flexBasis.unit === PX) {\n computedStyle.flexBasis = b = flexBasis.value;\n basisList.push(b);\n basisSum += b;\n }\n else if(flexBasis.unit === PERCENT) {\n b = computedStyle.flexBasis = (isDirectionRow ? w : h) * flexBasis.value * 0.01;\n basisList.push(b);\n basisSum += b;\n }\n maxSum += max;\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n shrinkSum += 1;\n if(isDirectionRow) {\n basisList.push(item.textWidth);\n basisSum += item.textWidth;\n maxSum += item.textWidth;\n minList.push(item.charWidth);\n }\n else {\n item.__layout({\n x: 0,\n y: 0,\n w,\n h,\n }, true);\n basisList.push(item.height);\n basisSum += item.height;\n maxSum += item.height;\n minList.push(item.height);\n }\n }\n });\n if(isVirtual) {\n this.__width = Math.min(maxX, w);\n return;\n }\n let maxCross = 0;\n // 判断是否超出,决定使用grow还是shrink\n let isOverflow = maxSum > (isDirectionRow ? w : h);\n flowChildren.forEach((item, i) => {\n let main;\n let shrink = shrinkList[i];\n let grow = growList[i];\n // 计算主轴长度\n if(isOverflow) {\n let overflow = basisSum - (isDirectionRow ? w : h);\n main = shrink ? (basisList[i] - overflow * shrink / shrinkSum) : basisList[i];\n }\n else {\n let free = (isDirectionRow ? w : h) - basisSum;\n main = grow ? (basisList[i] + free * grow / growSum) : basisList[i];\n }\n // 主轴长度的最小值不能小于元素的最小长度,比如横向时的字符宽度\n main = Math.max(main, minList[i]);\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n let {\n display,\n flexDirection,\n width,\n height,\n } = currentStyle;\n // flex的child如果是inline,变为block\n if(display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n if(isDirectionRow) {\n // 横向flex的child如果是竖向flex,高度自动的话要等同于父flex的高度\n if(display === 'flex' && flexDirection === 'column' && fixedHeight && height.unit === AUTO) {\n height.value = h;\n height.unit = PX;\n }\n item.__layout({\n x,\n y,\n w: main,\n h,\n });\n }\n else {\n // 竖向flex的child如果是横向flex,宽度自动的话要等同于父flex的宽度\n if(display === 'flex' && flexDirection === 'row' && width.unit === AUTO) {\n width.value = w;\n width.unit = PX;\n }\n item.__layout({\n x,\n y,\n w,\n h: main,\n });\n }\n // 重设因伸缩而导致的主轴长度\n if(isOverflow && shrink || !isOverflow && grow) {\n let {\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = computedStyle;\n if(isDirectionRow) {\n item.__width = main - marginLeft - marginRight - paddingLeft - paddingRight - borderLeftWidth - borderRightWidth;\n }\n else {\n item.__height = main - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n }\n else {\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? w - x + data.x : h - y + data.y;\n // 主轴侧轴对齐方式\n if(!isOverflow && growSum === 0 && diff > 0) {\n let len = flowChildren.length;\n if(justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = flowChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n // 子元素侧轴伸展\n if(isDirectionRow) {\n // 父元素固定高度,子元素可能超过,侧轴最大长度取固定高度\n if(fixedHeight) {\n maxCross = h;\n }\n y += maxCross;\n }\n else {\n if(fixedWidth) {\n maxCross = w;\n }\n }\n // 侧轴对齐\n if(!isVirtual) {\n if(alignItems === 'stretch') {\n // 短侧轴的children伸张侧轴长度至相同,超过的不动,固定宽高的也不动\n flowChildren.forEach(item => {\n let { computedStyle, currentStyle: { alignSelf, width, height } } = 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(alignSelf === 'flex-start') {}\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n if(alignSelf === 'flex-start') {}\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(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 { currentStyle: { alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { height } } = item;\n let {\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n paddingTop,\n paddingBottom,\n } = computedStyle;\n if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n }\n else {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { width } } = item;\n let {\n borderRightWidth,\n borderLeftWidth,\n marginRight,\n marginLeft,\n paddingRight,\n paddingLeft,\n } = computedStyle;\n if(width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\n else {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n }\n });\n }\n else if(alignItems === 'flex-end') {\n flowChildren.forEach(item => {\n let { currentStyle: { alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { height } } = item;\n let {\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n paddingTop,\n paddingBottom,\n } = computedStyle;\n if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n else {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n }\n else {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { width } } = item;\n let {\n borderRightWidth,\n borderLeftWidth,\n marginRight,\n marginLeft,\n paddingRight,\n paddingLeft,\n } = computedStyle;\n if(width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\n else {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n }\n });\n }\n else {\n flowChildren.forEach(item => {\n let { currentStyle: { alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { height } } = item;\n let {\n borderTopWidth,\n borderBottomWidth,\n marginTop,\n marginBottom,\n paddingTop,\n paddingBottom,\n } = computedStyle;\n if(height.unit === AUTO) {\n item.__height = computedStyle.height = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n }\n }\n }\n else {\n if(alignSelf === 'flex-start') {\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { width } } = item;\n let {\n borderRightWidth,\n borderLeftWidth,\n marginRight,\n marginLeft,\n paddingRight,\n paddingLeft,\n } = computedStyle;\n if(width.unit === AUTO) {\n item.__width = computedStyle.width = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n }\n }\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.currentStyle.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 /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, innerWidth, innerHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n display,\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingLeft,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target && target !== item) {\n return;\n }\n let { currentStyle, computedStyle } = item;\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, innerWidth);\n if(computedStyle.display === 'inline') {\n currentStyle.display = computedStyle.display = 'block';\n }\n let { left, top, right, bottom, width, height, display, flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left.unit !== AUTO) {\n fixedLeft = true;\n computedStyle.left = calAbsolute(currentStyle, 'left', left, innerWidth);\n }\n else {\n computedStyle.left = 'auto';\n }\n if(right.unit !== AUTO) {\n fixedRight = true;\n computedStyle.right = calAbsolute(currentStyle, 'right', right, innerWidth);\n }\n else {\n computedStyle.right = 'auto';\n }\n if(top.unit !== AUTO) {\n fixedTop = true;\n computedStyle.top = calAbsolute(currentStyle, 'top', top, innerHeight);\n }\n else {\n computedStyle.top = 'auto';\n }\n if(bottom.unit !== AUTO) {\n fixedBottom = true;\n computedStyle.bottom = calAbsolute(currentStyle, 'bottom', bottom, innerHeight);\n }\n else {\n computedStyle.bottom = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle.left;\n w2 = x + innerWidth - computedStyle.right - x2;\n }\n else if(fixedLeft && width.unit !== AUTO) {\n x2 = x + computedStyle.left;\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n else if(fixedRight && width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n x2 = x + innerWidth - computedStyle.right - w2;\n // 右对齐有尺寸时y值还需减去margin/border/padding的\n x2 -= computedStyle.marginLeft;\n x2 -= computedStyle.marginRight;\n x2 -= computedStyle.paddingLeft;\n x2 -= computedStyle.paddingRight;\n x2 -= currentStyle.borderLeftWidth.value;\n x2 -= currentStyle.borderRightWidth.value;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle.left;\n }\n else if(fixedRight) {\n x2 = x + innerWidth - computedStyle.right;\n onlyRight = true;\n }\n else {\n x2 = x + paddingLeft;\n if(width.unit !== AUTO) {\n w2 = width.unit === PX ? width.value : innerWidth * width.value * 0.01;\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle.top;\n h2 = y + innerHeight - computedStyle.bottom - y2;\n }\n else if(fixedTop && height.unit !== AUTO) {\n y2 = y + computedStyle.top;\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n else if(fixedBottom && height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n y2 = y + innerHeight - computedStyle.bottom - h2;\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle.marginTop;\n y2 -= computedStyle.marginBottom;\n y2 -= computedStyle.paddingTop;\n y2 -= computedStyle.paddingBottom;\n y2 -= currentStyle.borderTopWidth.value;\n y2 -= currentStyle.borderBottomWidth.value;\n }\n else if(fixedTop) {\n y2 = y + computedStyle.top;\n }\n else if(fixedBottom) {\n y2 = y + innerHeight - computedStyle.bottom;\n onlyBottom = true;\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y;\n let prev = item.prev;\n while(prev) {\n if(prev instanceof Text || prev.computedStyle.position !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(!prev) {\n y2 = y;\n }\n if(height.unit !== AUTO) {\n h2 = height.unit === PX ? height.value : innerHeight * height.value * 0.01;\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if(display === 'block' && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : innerWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : innerHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target && target !== item) {\n return;\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n }\n\n render(renderMode, lv, ctx, defs) {\n // 无论缓存与否,都需执行,因为有计算或svg,且super自身判断了缓存情况省略渲染\n let res = super.render(renderMode, lv, ctx, defs);\n res = res || {};\n let { offScreen, isDestroyed, displayNone } = res;\n // canvas检查filter,无缓存时的绘制\n if(offScreen && offScreen.target && offScreen.target.ctx) {\n ctx = offScreen.target.ctx;\n }\n // 降级,有offScreen但没离屏canvas/webgl功能,舍弃blur\n else {\n offScreen = null;\n }\n let { root, virtualDom, children,\n computedStyle: { position } } = this;\n // 不显示的为了diff也要根据type生成\n if(renderMode === mode.SVG) {\n virtualDom.type = 'dom';\n }\n // canvas在隐藏时返回空,svg则有内容\n if(isDestroyed || displayNone) {\n return res;\n }\n // filter特殊缓存\n let blurValue = this.__blurValue;\n // 有filter时改变除filter之外的变化直接返回\n if(renderMode === mode.CANVAS && blurValue && this.__cacheFilter\n && lv < level.REPAINT && !level.contain(lv, level.FILTER)) {\n return res;\n }\n this.__cacheFilter = null;\n // 先检查是否有缓存且刷新等级在REPAINT以下,直接跳过无需继续\n let cacheTotal = this.__cacheTotal;\n if(lv < level.REPAINT && cacheTotal && cacheTotal.available) {\n if(renderMode === mode.CANVAS && blurValue) {\n // blur变化更新,用新的bbox先偏移cacheTotal,再更新cacheFilter,保持尺寸和边距一致性\n if(level.contain(lv, level.FILTER)) {\n let bbox = this.__mergeBbox(null, true);\n let newCache = Cache.updateCache(cacheTotal, bbox);\n if(newCache) {\n this.__cacheTotal = newCache;\n this.__cacheFilter = Cache.genOffScreenBlur(cacheTotal, blurValue);\n }\n // 更新后超限,丢掉blur降级\n else {\n console.error('CacheTotal is oversize');\n this.__cacheTotal = null;\n this.__cacheFilter = null;\n }\n }\n }\n return res;\n }\n // 先渲染过滤mask,仅svg进入,canvas在下面自身做,记得只首次执行\n if(renderMode === mode.SVG && !this.__noChildMask) {\n let hasMask;\n children.forEach(item => {\n if(!(item instanceof Component) && (item.isMask || item.isClip)) {\n hasMask = true;\n item.__renderAsMask(renderMode, item.__refreshLevel, ctx, defs, !item.isMask);\n }\n });\n // 没mask标识以后无需重复遍历\n if(!hasMask) {\n this.__noChildMask = true;\n }\n }\n // 查找所有非文本children是否都可以放入此层整体缓存,比如有的超尺寸或离屏功能不可用或动画执行影响\n let canCacheChildren = true;\n let draw = !root.cache || renderMode === mode.SVG;\n // 按照zIndex排序绘制过滤mask,同时由于svg严格按照先后顺序渲染,没有z-index概念,需要排序将relative/absolute放后面\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n // cache时canvas模式需将mask/clip的geom照常绘制出来,且保证先于其它孩子绘制\n if(root.cache && renderMode === mode.CANVAS) {\n let maskChildren = this.__maskChildren = this.__maskChildren || getMaskChildren(this);\n if(maskChildren.length) {\n zIndexChildren = maskChildren.concat(zIndexChildren);\n }\n }\n zIndexChildren.forEach(item => {\n // canvas开启缓存text先不渲染,节点先绘制到自身cache上\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(draw) {\n if(renderMode === mode.CANVAS) {\n if(ctx.globalAlpha !== this.__opacity) {\n ctx.globalAlpha = this.__opacity;\n }\n ctx.setTransform(...this.matrixEvent);\n }\n item.__renderByMask(renderMode, null, ctx);\n }\n }\n else {\n let lv2 = item.__refreshLevel;\n // geom需特殊处理,避免自定义geom覆盖render()时感知离屏功能\n let blurValue;\n let newCtx = ctx;\n let isGeom = item instanceof Geom;\n // geom计算bbox需提前获得数据\n if(isGeom) {\n item.__preData = item.__preSet(renderMode, ctx, defs);\n }\n let ignoreGeom, offScreen2;\n if(renderMode === mode.CANVAS && isGeom) {\n let filter = item.currentStyle.filter;\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n blurValue = v;\n }\n });\n }\n // 提前判断申请geom的cache,有老的用老的,没有申请新的,改写render()的ctx避免自定义geom感知离屏功能\n if(root.cache) {\n let cacheFilter = item.__cacheFilter, cacheMask = item.__cacheMask, cache = item.__cache;\n if(cacheFilter && blurValue && lv < level.REPAINT && !level.contain(lv2, level.FILTER) || cacheMask) {\n ignoreGeom = true;\n }\n else {\n item.__cacheFilter = item.__cacheMask = null;\n let bbox = item.bbox;\n // filter优先使用mask,再是cache\n if(lv2 < level.REPAINT && cache && cache.available) {\n ignoreGeom = true;\n if(blurValue && level.contain(lv2, level.FILTER)) {\n if(cacheMask) {\n cacheMask = item.__cacheMask = Cache.updateCache(cacheMask, bbox);\n }\n cache = item.__cache = Cache.updateCache(cache, bbox);\n if(cacheMask || cache && cache.available) {\n item.__cacheFilter = Cache.genOffScreenBlur(cacheMask || cache, blurValue);\n }\n // 更新后超限,丢掉blur降级\n else {\n console.error('Geom cache is oversize');\n item.__cache = null;\n }\n }\n }\n else {\n if(cache) {\n if(cache.enabled) {\n if(lv2 < level.REPAINT) {\n if(level.contain(lv2, level.FILTER)) {\n cache.reset(bbox);\n }\n }\n else {\n cache.reset(bbox);\n }\n }\n else {\n cache.reset(bbox);\n }\n }\n else {\n cache = item.__cache = Cache.getInstance(bbox);\n }\n if(cache && cache.enabled) {\n newCtx = cache.ctx;\n }\n }\n }\n }\n else if(blurValue) {\n let { width, height } = root;\n let c = inject.getCacheCanvas(width, height, '__$$blur$$__');\n if(c.ctx) {\n offScreen2 = {\n ctx,\n };\n offScreen2.target = c;\n newCtx = c.ctx;\n }\n }\n }\n // 即便ignore也要render(),要计算matrix,xom里也会判断重复\n let temp = item.__renderByMask(renderMode, lv2, newCtx, defs);\n if(ignoreGeom) {\n temp = { canCache: true };\n }\n // geom特殊处理filter,分缓存和非缓存情况\n if(renderMode === mode.CANVAS && isGeom && !ignoreGeom) {\n let hasMC;\n let next = item.next;\n let hasMask = next && next.isMask;\n let hasClip = next && next.isClip;\n if(hasMask || hasClip) {\n hasMC = true;\n }\n let cacheMask = item.__cacheMask, cache = item.__cache;\n // 先尝试绘制mask,再看filter\n if(root.cache && hasMC && cache && cache.available) {\n let { transform, transformOrigin } = item.computedStyle;\n item.__cacheMask = Cache.drawMask(cache, next, transform, transformOrigin.slice(0));\n }\n if(root.cache && blurValue && (cacheMask || cache && cache.available)) {\n item.__cacheFilter = Cache.genOffScreenBlur(cacheMask || cache, blurValue);\n }\n else if(offScreen2) {\n let { width, height } = root;\n let webgl = inject.getCacheWebgl(width, height, '__$$blur$$__');\n let res = blur.gaussBlur(offScreen2.target, webgl, blurValue, width, height);\n offScreen2.ctx.drawImage(offScreen2.target.canvas, 0, 0);\n offScreen2.target.draw();\n res.clear();\n }\n }\n // Xom类型canvas无有效动画时方可被父亲缓存,svg用不到\n if(!canCacheChildren || !temp || !temp.canCache || item.availableAnimating) {\n canCacheChildren = false;\n }\n }\n });\n /**\n * canvas决定是否作为一个局部整体是否缓存的因素\n * 首先本身无有影响的动画,且children无有效的动画\n * 然后本身是relative/absolute/Component\n * root作为最后执行,即便不满足条件也要特殊处理,重复递归应用缓存\n * 目前处于递归的回溯阶段,即冒泡阶段,\n * 所有局部根节点进行绘制局部整体缓存,待root再次递归执行一次\n * filter是个特殊情况,需要webgl离屏执行,所以一定有缓存\n * 有mask也是个特殊情况,一定需要total\n * svg则不需要这些,vd上cache标明整体缓存无需递归diff\n */\n let canCacheSelf = renderMode === mode.CANVAS\n && (canCacheChildren && !this.effectiveAnimating || blurValue);\n if(canCacheSelf && !blurValue && ['relative', 'absolute'].indexOf(position) === -1 && !this.isShadowRoot) {\n canCacheSelf = false;\n }\n let hasMC;\n if(renderMode === mode.CANVAS) {\n let next = this.next;\n let hasMask = next && next.isMask;\n let hasClip = next && next.isClip;\n if(hasMask || hasClip) {\n hasMC = true;\n canCacheSelf = true;\n }\n }\n // 需考虑缓存和滤镜\n if(renderMode === mode.CANVAS) {\n // 冒泡阶段将所有局部整体缓存离屏绘制好以便调用\n if(root.cache) {\n // root最终执行,递归所有children应用自身缓存,遇到局部根节点离屏缓存则绘制到主屏上\n if(this === root) {\n this.__applyCache(renderMode, lv, ctx, refreshMode.ROOT);\n }\n // 作为局部根节点整体进行绘制并缓存,递归将所有子节点绘制到局部整体上,img除外自己处理\n else if(canCacheSelf && this.tagName.toLowerCase() !== 'img') {\n this.__applyCache(renderMode, lv, ctx, refreshMode.TOP);\n if(hasMC) {\n let cacheTotal = this.__cacheTotal;\n if(cacheTotal && cacheTotal.available) {\n let { transform, transformOrigin } = this.computedStyle;\n let next = this.next;\n this.__cacheMask = Cache.drawMask(cacheTotal, next, transform, transformOrigin.slice(0));\n }\n // 极端情况超限异常\n else {\n console.error('CacheTotal is oversize with mask');\n }\n }\n }\n // 非局部缓存的节点等待root调用\n }\n // 无缓存时有offScreen对象,尝试使用webgl的blur,对象生成条件在Xom初始化做\n else if(offScreen) {\n let { width, height } = root;\n let webgl = inject.getCacheWebgl(width, height, '__$$blur$$__');\n let res = blur.gaussBlur(offScreen.target, webgl, offScreen.blur, width, height);\n offScreen.ctx.drawImage(offScreen.target.canvas, 0, 0);\n offScreen.target.draw();\n res.clear();\n }\n }\n else if(renderMode === mode.SVG) {\n // svg mock,每次都生成,每个节点都是局部根,更新时自底向上清除\n if(!cacheTotal) {\n this.__cacheTotal = {\n available: true,\n release() {\n this.available = false;\n delete virtualDom.cache;\n },\n };\n }\n else if(!cacheTotal.available) {\n cacheTotal.available = true;\n }\n // img的children在子类特殊处理\n if(this.tagName.toLowerCase() !== 'img') {\n virtualDom.children = zIndexChildren.map(item => item.virtualDom);\n }\n // 没变化则将text孩子设置cache\n if(virtualDom.hasOwnProperty('lv')) {\n this.virtualDom.children.forEach(item => {\n if(item.type === 'text') {\n item.cache = true;\n }\n });\n }\n else {\n this.virtualDom.children.forEach(item => {\n if(item.type === 'text') {\n delete item.cache;\n }\n });\n }\n }\n // 向上回溯传值,要考虑children\n if(res.canCache && !canCacheChildren) {\n res.canCache = false;\n }\n res.canCacheSelf = canCacheSelf;\n res.hasMC = hasMC;\n return res;\n }\n\n /**\n * canvas下,应用离屏内容缓存到主屏或者局部根节点上\n * 有可能子节点没超限但整体超限,此时要考虑降级分别绘制\n * @param renderMode\n * @param lv\n * @param ctx\n * @param mode 局部根节点总缓存、及其子节点、最后root发起的无局部整体的节点自身缓存应用\n * @param cacheTop 汇总离屏canvas的目标\n * @param opacity 以top为基点\n * @param matrix 以top为基点\n */\n __applyCache(renderMode, lv, ctx, mode, cacheTop, opacity, matrix) {\n let {\n computedStyle,\n __blurValue: blurValue,\n __cacheMask: cacheMask,\n __cacheFilter: cacheFilter,\n __cacheTotal: cacheTotal,\n __cache: cache,\n zIndexChildren,\n } = this;\n let { display, visibility } = computedStyle;\n if(display === 'none') {\n return;\n }\n // 局部根节点缓存汇总渲染\n if(mode === refreshMode.TOP) {\n if(visibility === 'hidden') {\n return;\n }\n let bboxTotal = this.__mergeBbox(null, true);\n // 空内容\n if(!bboxTotal) {\n return;\n }\n // 第一次初始化进行bbox合集计算\n if(!cacheTotal) {\n cacheTotal = this.__cacheTotal = Cache.getInstance(bboxTotal);\n }\n // 后续如果超过可缓存的lv重设,否则直接用已有内容,重复利用在render()里做了,这里reset\n else if(!cacheTotal.enabled) {\n cacheTotal.reset(bboxTotal);\n }\n let { sx, sy } = this;\n let x1 = sx + computedStyle.marginLeft;\n let y1 = sy + computedStyle.marginTop;\n // 缓存可用时各children依次执行进行离屏汇总\n if(cacheTotal && cacheTotal.enabled) {\n cacheTotal.__bbox = bboxTotal;\n cacheTotal.__appendData(x1, y1);\n // 每次刷新重新生成,一般都会进,特殊情况下遗留的老cacheTotal可以直接用\n if(!cacheTotal.available) {\n cacheTotal.__available = true;\n ctx = cacheTotal.ctx;\n // 以top为基准matrix/opacity\n if(ctx.globalAlpha !== 1) {\n ctx.globalAlpha = 1;\n }\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n if(cache && cache.available) {\n Cache.drawCache(cache, cacheTotal);\n }\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(ctx.globalAlpha !== 1) {\n ctx.globalAlpha = 1;\n }\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n item.__renderByMask(renderMode, null, ctx, null, cacheTotal.dx, cacheTotal.dy);\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, refreshMode.CHILD, cacheTotal, 1, [1, 0, 0, 1, 0, 0]);\n }\n });\n }\n }\n // 超尺寸无法进行,降级渲染\n else {\n let tx = sx + computedStyle.marginLeft;\n let ty = sy + computedStyle.marginTop;\n super.__applyCache(renderMode, ctx, tx - 1, ty - 1);\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n item.__renderByMask(renderMode, null, ctx);\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, refreshMode.ROOT);\n }\n });\n }\n // 生成filter缓存,超尺寸降级舍弃\n if(blurValue && cacheTotal && cacheTotal.available) {\n this.__cacheFilter = Cache.genOffScreenBlur(cacheTotal, blurValue);\n }\n else if(cacheFilter) {\n console.error('CacheFilter is oversize');\n this.__cacheFilter = null;\n }\n }\n // 向总的离屏canvas绘制,最后由top汇总再绘入主画布\n else if(mode === refreshMode.CHILD) {\n let { coords: [tx, ty], x1, y1, dbx, dby } = cacheTop;\n let { sx, sy } = this;\n sx += computedStyle.marginLeft;\n sy += computedStyle.marginTop;\n let dx = tx + sx - x1 + dbx;\n let dy = ty + sy - y1 + dby;\n if(visibility !== 'hidden') {\n let tfo = computedStyle.transformOrigin.slice(0);\n opacity *= computedStyle.opacity;\n if(ctx.globalAlpha !== opacity) {\n ctx.globalAlpha = opacity;\n }\n // 优先filter/mask,再是total\n if(cacheFilter || cacheMask || cacheTotal && cacheTotal.available) {\n let target = cacheFilter || cacheMask || cacheTotal;\n Cache.drawCache(target, cacheTop, computedStyle.transform, matrix, tfo);\n return;\n }\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n matrix = mx.multiply(matrix, m);\n ctx.setTransform(...matrix);\n // 都没有正常cache和children\n if(cache && cache.available) {\n Cache.drawCache(cache, cacheTop);\n }\n }\n // 递归children\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(visibility !== 'hidden') {\n if(ctx.globalAlpha !== opacity) {\n ctx.globalAlpha = opacity;\n }\n ctx.setTransform(...matrix);\n item.__renderByMask(renderMode, null, ctx, null, dx - item.sx + computedStyle.paddingLeft, dy - item.sy + computedStyle.paddingTop);\n }\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, mode, cacheTop, opacity, matrix);\n }\n });\n }\n // root调用局部整体缓存或单个节点缓存绘入主画布\n else if(mode === refreshMode.ROOT) {\n let { __opacity, matrixEvent } = this;\n if(visibility !== 'hidden') {\n // 写回主画布前设置\n if(ctx.globalAlpha !== __opacity) {\n ctx.globalAlpha = __opacity;\n }\n ctx.setTransform(...matrixEvent);\n let target = cacheFilter || cacheMask;\n if(target) {\n let { x1, y1, dbx, dby, canvas } = target;\n ctx.drawImage(canvas, x1 - 1 - dbx, y1 - 1 - dby);\n return;\n }\n if(cacheTotal && cacheTotal.available) {\n let { coords: [x, y], canvas, x1, y1, dbx, dby, width, height } = cacheTotal;\n ctx.drawImage(canvas, x - 1, y - 1, width, height, x1 - 1 - dbx, y1 - 1 - dby, width, height);\n return;\n }\n // 无内容就没有cache,继续看children\n if(cache && cache.available) {\n let { coords: [x, y], canvas, x1, y1, dbx, dby, width, height } = cache;\n ctx.drawImage(canvas, x - 1, y - 1, width, height, x1 - 1 - dbx, y1 - 1 - dby, width, height);\n }\n }\n zIndexChildren.forEach(item => {\n if(item instanceof Text || item instanceof Component && item.shadowRoot instanceof Text) {\n if(visibility !== 'hidden') {\n if(ctx.globalAlpha !== __opacity) {\n ctx.globalAlpha = __opacity;\n }\n ctx.setTransform(...matrixEvent);\n item.__renderByMask(renderMode, null, ctx);\n }\n }\n else {\n item.__applyCache(renderMode, item.__refreshLevel, ctx, mode);\n }\n });\n }\n }\n\n /**\n * 以cacheTotal为基准递归合并包含children的bbox\n * @param matrix\n * @param isTop\n * @param tx 顶dom的坐标\n * @param ty\n * @param dx filter造成的偏移,递归传递下去所有children需要扩展此值\n * @param dy\n * @returns bbox\n * @private\n */\n __mergeBbox(matrix, isTop, tx, ty, dx, dy) {\n let bbox;\n let { sx, sy, computedStyle } = this;\n let display = computedStyle.display;\n // 顶点初始化为起点,偏移值要考虑filter\n if(isTop) {\n matrix = [1, 0, 0, 1, 0, 0];\n bbox = super.__mergeBbox(matrix, isTop);\n tx = sx;\n ty = sy;\n if(bbox) {\n dx = sx + computedStyle.marginLeft - bbox[0];\n dy = sy + computedStyle.marginTop - bbox[1];\n }\n else if(Array.isArray(computedStyle.filter)) {\n computedStyle.filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let d = mx.int2convolution(v);\n dx = dy = d;\n }\n });\n }\n else {\n dx = dy = 0;\n }\n }\n else if(display !== 'none') {\n let tfo = computedStyle.transformOrigin.slice(0);\n tfo[0] += sx - tx;\n tfo[1] += sy - ty;\n let m = tf.calMatrixByOrigin(computedStyle.transform, tfo);\n matrix = mx.multiply(matrix, m);\n bbox = super.__mergeBbox(matrix, isTop, dx, dy);\n }\n if(display !== 'none') {\n this.zIndexChildren.forEach(item => {\n let t = item.__mergeBbox(matrix, false, tx, ty, dx, dy);\n if(!bbox) {\n bbox = t;\n }\n // display:none可能为空\n else if(t) {\n bbox[0] = Math.min(bbox[0], t[0]);\n bbox[1] = Math.min(bbox[1], t[1]);\n bbox[2] = Math.max(bbox[2], t[2]);\n bbox[3] = Math.max(bbox[3], t[3]);\n }\n });\n }\n return bbox;\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param isHost\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, isHost, cb) {\n super.__computeMeasure(renderMode, ctx, isHost, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, false, cb);\n });\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n this.children.splice(0);\n this.lineGroups.splice(0);\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle } = this;\n if(isDestroyed || computedStyle.display === 'none' || e.__stopPropagation) {\n return;\n }\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n }\n // child不触发再看自己\n return super.__emitEvent(e);\n }\n\n __cancelCache(recursion) {\n super.__cancelCache(recursion);\n if(recursion) {\n this.children.forEach(child => {\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n child.__cancelCache(recursion);\n }\n });\n }\n }\n\n // 深度遍历执行所有子节点,包含自己,如果cb返回true,提前跳出不继续深度遍历\n deepScan(cb, options) {\n if(super.deepScan(cb, options)) {\n return;\n }\n this.children.forEach(node => {\n node.deepScan(cb, options);\n });\n }\n\n get children() {\n return this.__children;\n }\n\n get flowChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Text || item.currentStyle.position !== 'absolute';\n });\n }\n\n get absChildren() {\n return this.children.filter(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n return item instanceof Xom && item.currentStyle.position === 'absolute';\n });\n }\n\n get zIndexChildren() {\n return this.__zIndexChildren || [];\n }\n\n get lineGroups() {\n return this.__lineGroups;\n }\n\n get baseLine() {\n let len = this.lineGroups.length;\n if(len) {\n let last = this.lineGroups[len - 1];\n return last.y - this.y + last.baseLine;\n }\n return this.y;\n }\n}\n\nexport default Dom;\n","import Dom from './Dom';\nimport mode from './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport transform from '../style/transform';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\nimport refreshMode from '../refresh/mode';\nimport Cache from '../refresh/Cache';\n\nconst { AUTO } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {};\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = this.props.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.url = src;\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, 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 virtualDom,\n __cache,\n } = this;\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return res;\n }\n let originX, originY;\n // img无children所以total就是cache避免多余生成\n if(renderMode === mode.CANVAS) {\n this.__cacheTotal = __cache;\n }\n if(__cache && __cache.enabled) {\n ctx = __cache.ctx;\n originX = res.x2 + paddingLeft;\n originY = res.y2 + paddingTop;\n }\n else {\n originX = x + marginLeft + borderLeftWidth + paddingLeft;\n originY = y + marginTop + borderTopWidth + paddingTop;\n }\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 // virtualDom.children = [];\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(loadImg.url === src) {\n let source = loadImg.source;\n // 无source不绘制\n if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let id = defs.add({\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n });\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !util.equalArr(matrix, [1, 0, 0, 1, 0, 0])) {\n props.push(['transform', 'matrix(' + util.joinArr(matrix, ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n }\n else {\n let loadImg = this.__loadImg;\n loadImg.url = src;\n loadImg.source = null;\n loadImg.error = null;\n loadImg.cache = false;\n inject.measureImg(src, data => {\n let self = this;\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.url && !self.__isDestroyed) {\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else {\n loadImg.error = true;\n }\n let { root, currentStyle: { width, height } } = self;\n root.delRefreshTask(self.__task);\n if(width.unit !== AUTO && height.unit !== AUTO) {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REPAINT,\n img: true,\n });\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n before() {\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n root.__addUpdate({\n node: self,\n focus: level.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行\n img: true, // 特殊标识强制布局即便没有style变化\n });\n },\n });\n }\n }\n }, {\n width,\n height,\n });\n }\n if(res.canCacheSelf) {\n this.__applyCache(renderMode, lv, ctx, refreshMode.TOP);\n if(res.hasMC) {\n let cacheTotal = this.__cacheTotal;\n if(cacheTotal && cacheTotal.available) {\n let { transform, transformOrigin } = this.computedStyle;\n let next = this.next;\n this.__cacheMask = Cache.drawMask(cacheTotal, next, transform, transformOrigin.slice(0));\n }\n // 极端情况超限异常\n else {\n console.error('CacheTotal is oversize with img\\'s mask');\n }\n }\n }\n return res;\n }\n\n get baseLine() {\n return this.height;\n }\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n }\n add(data) {\n data.uuid = 'karas-defs-' + this.id + '-' + this.count++;\n this.list.push(data);\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import util from './util';\nimport builder from './builder';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n}\n\n/**\n * 检查cp是否有state变更\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n check(cp.shadowRoot);\n }\n }\n else {\n check(cp.shadowRoot);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.__state = state;\n cp.__nextState = null;\n let oldS = cp.shadow;\n let oldJson = cp.__cd;\n let json = builder.flattenJson(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let s = cp.shadow;\n if(s instanceof Xom) {\n s.__width = oldS.width;\n s.__height = oldS.height;\n s.__computedStyle = oldS.computedStyle;\n s.__layoutData = oldS.layoutData;\n }\n else {\n s.__parent = oldS.parent;\n }\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.placeholder) {\n delete json.placeholder;\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.inherit = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.inherit = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建\n // 否则需要强制触发组件更新,包含setState内容\n nj.placeholder = true;\n nj.value = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n console.error('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList = [];\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n updateList,\n check,\n checkCp,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\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 // = 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, visibility, mask, clip, filter, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(ovd.clip) {\n elem.removeAttribute('clip-path');\n }\n }\n if(ovd.clip !== clip) {\n if(clip) {\n elem.setAttribute('clip-path', clip);\n }\n else {\n elem.removeAttribute('clip-path');\n }\n if(ovd.mask) {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter) {\n if(filter) {\n elem.setAttribute('filter', filter);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n if(lv === level.NONE) {\n return;\n }\n let { transform, opacity, visibility, mask, clip, filter } = nvd;\n if(level.contain(lv, level.TRANSLATE_X | level.TRANSLATE_Y | level.TRANSFORM)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(level.contain(lv, level.OPACITY)) {\n if(opacity !== 1) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(level.contain(lv, level.VISIBILITY)) {\n elem.setAttribute('visibility', visibility);\n }\n if(level.contain(lv, level.FILTER)) {\n if(filter) {\n elem.setAttribute('filter', filter);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(ovd.clip) {\n elem.removeAttribute('clip-path');\n }\n if(clip) {\n elem.setAttribute('clip-path', clip);\n }\n else {\n elem.removeAttribute('clip-path');\n }\n if(ovd.mask) {\n elem.removeAttribute('mask');\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb, ovd.bbClip, nvd.bbClip);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(lastChild, i, ovd.children[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb, oClip, nClip) {\n let ol = obb.length;\n let nl = nbb.length;\n if(oClip !== nClip) {\n if(!nClip) {\n elem.removeAttribute('clip-path');\n }\n else {\n elem.setAttribute('clip-path', nClip);\n }\n }\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n add(v) {\n if(this.__list.indexOf(v) === -1) {\n this.list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__auto = [];\n this.__list = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(list = this.__records) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(list.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n list.splice(0).forEach(item => {\n let { target, animate } = item;\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o);\n }\n });\n }\n }\n\n __playAuto() {\n this.init(this.__auto);\n this.__action('play');\n }\n\n play(cb) {\n this.init();\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n cancel(cb) {\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.init();\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n get list() {\n return this.__list;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Component from './Component';\nimport Defs from './Defs';\nimport mode from './mode';\nimport Geom from '../geom/Geom';\nimport builder from '../util/builder';\nimport updater from '../util/updater';\nimport util from '../util/util';\nimport diff from '../util/diff';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport inject from '../util/inject';\nimport Event from '../util/Event';\nimport frame from '../animate/frame';\nimport Controller from '../animate/Controller';\nimport change from '../refresh/change';\nimport level from '../refresh/level';\n\nconst { isNil, isObject, isFunction } = util;\nconst { AUTO, PX, PERCENT } = unit;\nconst { calRelative, isRelativeOrAbsolute } = css;\n\nfunction getDom(dom) {\n if(util.isString(dom) && dom) {\n let o = document.querySelector(dom);\n if(!o) {\n throw new Error('Can not find dom of selector: ' + dom);\n }\n return o;\n }\n if(!dom) {\n throw new Error('Can not find dom: ' + dom);\n }\n return dom;\n}\n\nfunction renderProp(k, v) {\n let s = Array.isArray(v) ? util.joinSourceArray(v) : util.stringify(v);\n if(k === 'className') {\n k = 'class';\n }\n return ' ' + k + '=\"' + util.encodeHtml(s, true) + '\"';\n}\n\nfunction initEvent(dom) {\n ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'touchcancel'].forEach(type => {\n dom.addEventListener(type, e => {\n let root = dom.__root;\n if(['touchend', 'touchcancel', 'touchmove'].indexOf(type) > -1) {\n root.__touchstartTarget && root.__touchstartTarget.__emitEvent(root.__wrapEvent(e), true);\n }\n else {\n root.__cb(e);\n }\n });\n });\n}\n\n// 提取出对比节点尺寸是否修改,用currentStyle的对比computedStyle的\nfunction isFixedWidthOrHeight(node, root, k) {\n let c = node.currentStyle[k];\n let v = node.computedStyle[k];\n if(c.unit === PX) {\n return c.value === v;\n }\n if(c.unit === PERCENT) {\n let parent = node.domParent;\n let s = parent.layoutData[k === 'width' ? 'w' : 'h'];\n return c.value * s * 0.01 === v;\n }\n return false;\n}\nfunction isFixedSize(node, root) {\n return isFixedWidthOrHeight(node, root, 'width') && isFixedWidthOrHeight(node, root, 'height');\n}\n\nconst OFFSET = 0;\nconst LAYOUT = 1;\nfunction isLAYOUT(node, hash) {\n return node.hasOwnProperty('__uniqueReflowId') && hash[node.__uniqueReflowId] >= LAYOUT;\n}\n\nfunction setLAYOUT(node, hash) {\n addLAYOUT(node, hash);\n hash[node.__uniqueReflowId].lv |= LAYOUT;\n}\n\nlet __uniqueReflowId = 0;\nfunction addLAYOUT(node, hash) {\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n hash[__uniqueReflowId++] = {\n node,\n lv: LAYOUT,\n };\n }\n}\n\nlet uniqueUpdateId = 0;\nfunction parseUpdate(renderMode, root, updateHash, target, reflowList, measureList, cacheHash, cacheList) {\n let { node, style, origin, overwrite, focus, img, measure, list } = target;\n // updateStyle()这样的调用还要计算normalize\n if(origin && style) {\n style = css.normalize(style);\n }\n // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复\n if(overwrite && style) {\n Object.assign(node.__style, style);\n }\n if(style && style !== target.style) {\n Object.assign(target.style, style);\n }\n // 多次调用更新才会有list,一般没有,优化\n if(list) {\n list.forEach(item => {\n let { style, origin, overwrite } = item;\n if(origin && style) {\n style = css.normalize(style);\n }\n if(overwrite && style) {\n Object.assign(node.__style, style);\n }\n if(style) {\n Object.assign(target.style, style);\n }\n });\n }\n style = target.style;\n // 按节点合并完style后判断改变等级\n let { tagName, currentStyle, currentProps, __cacheStyle = {}, __cacheProps = {} } = node;\n let lv = level.NONE;\n let p;\n let hasMeasure = measure;\n let hasZ;\n for(let k in style) {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n // 只有geom的props和style2种可能\n if(change.isGeom(tagName, k)) {\n if(!css.equalStyle(k, v, currentProps[k], node)) {\n p = p || {};\n p[k] = style[k];\n lv |= level.REPAINT;\n __cacheProps[k] = undefined;\n }\n }\n else {\n // 需和现在不等,且不是pointerEvents这种无关的\n if(!css.equalStyle(k, v, currentStyle[k], node)) {\n // pointerEvents这种无关的只需更新\n if(change.isIgnore(k)) {\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n else {\n // TRBL变化只对relative/absolute起作用,其它忽视\n if({ top: true, right: true, bottom: true, left:true }.hasOwnProperty(k)) {\n if(currentStyle.position !== 'relative' && currentStyle.position !== 'absolute'\n && style.position !== 'relative' && style.position !== 'absolute') {\n delete style[k];\n continue;\n }\n }\n // 只粗略区分出none/repaint/reflow,repaint细化等级在后续,reflow在checkReflow()\n lv |= level.getLevel(k);\n if(change.isMeasure(k)) {\n hasMeasure = true;\n }\n // repaint置空,如果reflow会重新生成空的\n __cacheStyle[k] = undefined;\n currentStyle[k] = v;\n }\n if(k === 'zIndex') {\n hasZ = true;\n }\n }\n }\n }\n }\n if(p) {\n Object.assign(currentProps, p);\n }\n if(style) {\n Object.assign(currentStyle, style);\n }\n if(!isNil(focus)) {\n lv |= focus;\n }\n // 无任何改变处理的去除记录,如pointerEvents、无效的left\n if(lv === level.NONE && !img) {\n delete node.__uniqueUpdateId;\n return;\n }\n // 记录下来清除parent的zIndexChildren缓存\n if(hasZ) {\n delete node.domParent.__zIndexChildren;\n }\n // reflow/repaint/measure相关的记录下来\n let isRepaint = level.isRepaint(lv);\n if(isRepaint) {\n // zIndex变化需清空svg缓存\n if(hasZ && renderMode === mode.SVG) {\n lv |= level.REPAINT;\n }\n if(!isNil(focus)) {\n lv |= focus;\n }\n }\n // reflow在root的refresh中做\n else {\n reflowList.push({\n node,\n style,\n img,\n });\n // measure需要提前先处理\n if(hasMeasure) {\n measureList.push(node);\n }\n }\n node.__refreshLevel = lv;\n // dom在>=REPAINT时total失效,svg的geom比较特殊,任何改变都失效\n let need = node.__refreshLevel >= level.REPAINT || renderMode === mode.SVG && node instanceof Geom;\n if(need) {\n if(node.__cache) {\n node.__cache.release();\n }\n if(node.__cacheTotal) {\n node.__cacheTotal.release();\n }\n if(node.__cacheMask) {\n node.__cacheMask = null;\n }\n }\n if((need || level.contain(lv, level.FILTER)) && node.__cacheFilter) {\n node.__cacheFilter = null;\n }\n // 向上清除等级>=REPAINT的汇总缓存信息,过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n let parent = node.domParent;\n // 向上查找,出现重复跳出\n while(parent) {\n if(parent.hasOwnProperty('__uniqueUpdateId')) {\n let id = parent.__uniqueUpdateId;\n if(cacheHash.hasOwnProperty(id)) {\n break;\n }\n cacheHash[id] = true;\n }\n // 没有的需要设置一个标识\n else {\n let id = parent.__uniqueUpdateId = uniqueUpdateId++;\n cacheHash[id] = true;\n cacheList.push(parent);\n }\n let lv = parent.__refreshLevel;\n let need = lv >= level.REPAINT;\n if(need && parent.__cache) {\n parent.__cache.release();\n }\n // 前面已经过滤了无改变NONE的,只要孩子有任何改变父亲就要清除\n if(parent.__cacheTotal) {\n parent.__cacheTotal.release();\n }\n if(parent.__cacheFilter) {\n parent.__cacheFilter = null;\n }\n if(parent.__cacheMask) {\n parent.__cacheMask = null;\n }\n parent = parent.domParent;\n }\n return true;\n}\n\nlet uuid = 0;\n\nclass Root extends Dom {\n constructor(tagName, props, children) {\n super(tagName, props);\n this.__cd = children || []; // 原始children,再初始化过程中生成真正的dom\n this.__dom = null; // 真实DOM引用\n this.__mw = 0; // 记录最大宽高,防止尺寸变化清除不完全\n this.__mh = 0;\n this.__scx = 1; // 默认缩放,css改变canvas/svg缩放后影响事件坐标\n this.__scy = 1;\n this.__task = [];\n this.__ref = {};\n this.__updateList = [];\n this.__updateHash = {};\n this.__reflowList = [{ node: this }]; // 初始化填自己,第一次布局时复用逻辑完全重新布局\n this.__animateController = new Controller();\n Event.mix(this);\n }\n\n __initProps() {\n let w = this.props.width;\n if(!isNil(w)) {\n let value = parseFloat(w) || 0;\n if(value > 0) {\n this.__width = value;\n }\n }\n let h = this.props.height;\n if(!isNil(h)) {\n let value = parseFloat(h) || 0;\n if(value > 0) {\n this.__height = value;\n }\n }\n }\n\n __genHtml() {\n let res = `<${this.tagName}`;\n // 拼接处理属性\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n // 忽略事件\n if(!/^on[a-zA-Z]/.test(k)) {\n res += renderProp(k, v);\n }\n });\n res += `>`;\n return res;\n }\n\n __wrapEvent(e) {\n let x, y;\n // 触摸结束取消特殊没有touches\n if(['touchend', 'touchcancel'].indexOf(e.type) === -1) {\n let { dom, __scx, __scy } = this;\n let { x: x2, y: y2, left, top } = dom.getBoundingClientRect();\n x = x2 || left || 0;\n y = y2 || top || 0;\n let { pageX, pageY } = e.touches ? e.touches[0] : e;\n x = pageX - x;\n y = pageY - y;\n // 外边的scale影响元素事件响应,根据倍数计算真实的坐标\n if(__scx !== 1) {\n x /= __scx;\n }\n if(__scy !== 1) {\n y /= __scy;\n }\n }\n return {\n event: e,\n stopPropagation() {\n this.__stopPropagation = true;\n e.stopPropagation();\n },\n stopImmediatePropagation() {\n this.__stopPropagation = true;\n this.__stopImmediatePropagation = true;\n e.stopImmediatePropagation();\n },\n preventDefault() {\n e.preventDefault();\n },\n x,\n y,\n __hasEmitted: false,\n };\n }\n\n // 类似touchend/touchcancel/touchmove这种无需判断是否发生于元素上,直接响应\n __cb(e) {\n if(e.type === 'touchmove' && !this.__touchstartTarget) {\n return;\n }\n let data = this.__wrapEvent(e);\n this.__emitEvent(data);\n return data;\n }\n\n appendTo(dom) {\n dom = getDom(dom);\n this.__children = builder.initRoot(this.__cd, this);\n this.__initProps();\n this.__root = this;\n this.cache = !!this.props.cache;\n // 已有root节点\n if(dom.nodeName.toUpperCase() === this.tagName.toUpperCase()) {\n this.__dom = dom;\n if(this.width) {\n dom.setAttribute('width', this.width);\n }\n if(this.height) {\n dom.setAttribute('height', this.height);\n }\n }\n // 没有canvas/svg节点则生成一个新的\n else {\n this.__dom = dom.querySelector(this.tagName);\n if(!this.__dom) {\n dom.innerHTML = this.__genHtml();\n this.__dom = dom.querySelector(this.tagName);\n }\n }\n this.__uuid = isNil(this.__dom.__uuid) ? uuid++ : this.__dom.__uuid;\n this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid);\n // 没有设置width/height则采用css计算形式\n if(!this.width || !this.height) {\n let css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root) {\n this.dom.__root.destroy();\n }\n else {\n initEvent(this.dom);\n this.dom.__uuid = this.__uuid;\n }\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,一般是同步,为了防止外部因素inject是异步写成了cb形式\n inject.measureText(() => {\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS) {\n this.__clear(ctx);\n }\n this.render(renderMode, this.__refreshLevel, ctx, defs);\n if(renderMode === mode.SVG) {\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__root) {\n diff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH);\n });\n }\n\n destroy() {\n this.__destroy();\n frame.offFrame(this.__rTask);\n let n = this.dom;\n if(n) {\n n.__root = null;\n }\n }\n\n scale(x = 1, y = x) {\n this.__scx = x;\n this.__scy = y;\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 let setStateList = [];\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.before)) {\n // 收集组件setState的更新,特殊处理\n if(item.__state) {\n setStateList.push(i);\n }\n item.before(diff);\n }\n });\n // 刷新前先进行setState检查,全都是setState触发的且没有更新则无需刷新\n if(setStateList.length) {\n updater.check(this);\n }\n // 有组件更新,则需要重新布局\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let sr = cp.shadowRoot;\n // 可能返回text,需视为其parentNode\n if(sr instanceof Text) {\n sr = sr.domParent;\n }\n this.__addUpdate({\n node: sr,\n style: sr.currentStyle,\n focus: level.REFLOW,\n measure: true, // 未知强制measure\n });\n });\n this.refresh();\n }\n // 有可能组件都不需要更新,且没有其它触发的渲染更新\n else if(clone.length > setStateList.length) {\n this.refresh();\n }\n // 避免重复刷新,在frame每帧执行中,比如图片进行了异步刷新,动画的hook就可以省略再刷新一次\n let r = this.__hookTask;\n if(r) {\n let hookTask = frame.__hookTask;\n let i = hookTask.indexOf(r);\n if(i > -1) {\n hookTask.splice(i, 1);\n }\n }\n // 触发didUpdate\n updater.did();\n }\n },\n after: diff => {\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.after)) {\n item.after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n }\n if(task.indexOf(cb) === -1) {\n task.push(cb);\n }\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n if(task[i] === cb) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n frame.offFrame(this.__rTask);\n }\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param width\n * @param height\n * @private\n */\n __checkRoot(width, height) {\n let { currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle.display) === -1) {\n computedStyle.display = currentStyle.display = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle.positoin === 'absolute') {\n computedStyle.position = currentStyle.positoin = 'static';\n }\n // 根节点满宽高\n currentStyle.width = {\n value: width,\n unit: PX,\n };\n currentStyle.height = {\n value: height,\n unit: PX,\n };\n computedStyle.width = width;\n computedStyle.height = height;\n // 继承值变默认,提前处理以便子节点根据parent计算\n css.computeMeasure(this, true);\n }\n\n /**\n * 添加更新入口,按节点汇总更新信息\n * @private\n */\n __addUpdate(o) {\n let updateHash = this.__updateHash;\n let { node, style, origin, overwrite, focus, img, measure } = o;\n // 事件队列和setState等原因,可能node已经销毁\n if(node.isDestroyed) {\n return;\n }\n // root特殊处理,检查变更时优先看继承信息\n if(node === this) {\n let target = this.__updateRoot;\n if(target) {\n if(img) {\n target.img = img;\n }\n if(focus) {\n target.focus = focus;\n }\n if(measure) {\n target.measure = true;\n }\n target.list = target.list || [];\n target.list.push({ style, origin, overwrite });\n }\n else {\n this.__updateRoot = {\n node,\n style,\n origin,\n overwrite,\n focus,\n img,\n measure,\n };\n }\n }\n else if(!node.hasOwnProperty('__uniqueUpdateId')) {\n node.__uniqueUpdateId = uniqueUpdateId;\n // 大多数情况节点都只有一次更新,所以优化首次直接存在style上,后续存在list\n updateHash[uniqueUpdateId++] = {\n node,\n style,\n origin,\n overwrite,\n focus,\n img,\n measure,\n };\n }\n else if(updateHash.hasOwnProperty(node.__uniqueUpdateId)) {\n let target = updateHash[node.__uniqueUpdateId];\n if(img) {\n target.img = img;\n }\n if(focus) {\n target.focus = focus;\n }\n if(measure) {\n target.measure = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n target.list = target.list || [];\n target.list.push({ style, origin, overwrite });\n }\n else {\n console.error('Update process miss uniqueUpdateId');\n }\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let measureList = [];\n let reflowList = [];\n let cacheHash = {};\n let cacheList = [];\n let updateRoot = this.__updateRoot;\n let updateHash = this.__updateHash;\n let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n this.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, this, updateHash, updateRoot, reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式\n this.__checkRoot(width, height);\n }\n // 汇总处理每个节点\n let keys = Object.keys(updateHash);\n keys.forEach(k => {\n hasUpdate = parseUpdate(renderMode, this, updateHash, updateHash[k], reflowList, measureList, cacheHash, cacheList) || hasUpdate;\n });\n // 先做一部分reset避免下面measureList干扰\n this.__reflowList = reflowList;\n uniqueUpdateId = 0;\n this.__updateHash = {};\n cacheList.forEach(item => {\n delete item.__uniqueUpdateId;\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __uniqueUpdateId, domParent: parent } = node;\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n let last = node;\n // 检查measure的属性是否是inherit\n let isInherit = change.isMeasureInherit(updateHash[__uniqueUpdateId].style);\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== this) {\n let { __uniqueUpdateId, currentStyle } = parent;\n let isInherit;\n if(parent.hasOwnProperty('__uniqueUpdateId')) {\n let style = updateHash[__uniqueUpdateId].style;\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.hasOwnProperty('__uniqueUpdateId')) {\n measureHash[target.__uniqueUpdateId] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n keys.forEach(k => {\n delete updateHash[k].node.__uniqueUpdateId;\n });\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响后面兄弟和父resize\n * 当flex变化时,如父是flex往上查找最上层flex视为其变化,如不是则影响所有递归子节点和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 一般需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n\n // 单独提出共用检测影响的函数,非absolute和relative的offset情况从节点本身开始向上分析影响\n function checkInfluence(node, focus) {\n // 自身尺寸固定且无变化,无需向上查找,但position发生变化的除外\n if(isFixedSize(node, root) && !focus) {\n return;\n }\n // cp强制刷新\n if(node instanceof Component) {\n return;\n }\n let target = node;\n // inline新老都影响,节点变为最近的父非inline\n if(node.currentStyle.display === 'inline' || node.computedStyle.display === 'inline') {\n let parent = node.domParent;\n do {\n target = parent;\n // 父到root提前跳出\n if(parent === root) {\n return true;\n }\n // 父已有LAYOUT跳出防重\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 遇到absolute跳出,如果absolute发生变化,一定会存在于列表中,不用考虑\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 父固定宽度跳出直接父进行LAYOUT即可\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n // 继续向上\n parent = parent.domParent;\n }\n while(parent && (parent.currentStyle.display === 'inline' || parent.computedStyle.display === 'inline'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果原本是inline则是其非inline父\n let parent = target.domParent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 检查flex,如果父是flex,向上查找flex顶点视作其更改\n if(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex')) {\n do {\n target = parent;\n if(parent === root) {\n return true;\n }\n if(isLAYOUT(parent, reflowHash)) {\n return;\n }\n if(parent.currentStyle.position === 'absolute' || parent.computedStyle.position === 'absolute') {\n setLAYOUT(parent, reflowHash);\n return;\n }\n if(isFixedSize(parent)) {\n setLAYOUT(parent, reflowHash);\n return;\n }\n parent = parent.domParent;\n }\n while(parent && (parent.computedStyle.display === 'flex' || parent.currentStyle.display === 'flex'));\n // target至少是node的parent,如果固定尺寸提前跳出\n if(isFixedSize(target)) {\n setLAYOUT(target, reflowHash);\n return;\n }\n }\n // 此时target指向node,如果父原本是flex则是其最上flex父\n parent = target.domParent;\n // parent有LAYOUT跳出,已被包含\n if(parent && isLAYOUT(parent, reflowHash)) {\n return;\n }\n // 向上查找了并且没提前跳出的,父重新布局\n if(target !== node) {\n setLAYOUT(target, reflowHash);\n }\n }\n\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let { node, style, img } = reflowList[i];\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n let { currentStyle, computedStyle } = node;\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = {\n node,\n lv: OFFSET,\n img,\n };\n }\n let o = reflowHash[node.__uniqueReflowId];\n // absolute无变化,只影响自己\n if(currentStyle.position === 'absolute' && computedStyle.position === 'absolute') {\n o.lv = LAYOUT;\n }\n // absolute和非absolute互换\n else if(currentStyle.position !== computedStyle.position) {\n o.lv = LAYOUT;\n if(checkInfluence(node, true)) {\n hasRoot = true;\n break;\n }\n }\n // 所有其它变化\n else {\n let onlyXY = true;\n if(style) {\n let keys = Object.keys(style);\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n if(k !== 'left' && k !== 'top' && k !== 'right' && k !== 'bottom') {\n onlyXY = false;\n break;\n }\n }\n }\n // relative只有x/y变化时特殊只进行OFFSET,非relative的忽视掉这个无用影响\n // img加载特殊进到这里强制LAYOUT\n if(onlyXY && !img) {\n if(computedStyle.position === 'relative') {\n o.lv |= OFFSET;\n }\n }\n // 剩余的其它变化\n else {\n o.lv = LAYOUT;\n if(checkInfluence(node)) {\n hasRoot = true;\n break;\n }\n }\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n return [reflowList, [{\n node: this,\n lv: LAYOUT,\n }]];\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n let uniqueList = [];\n this.deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n delete node.__uniqueReflowId; // 清除掉\n if(o.lv >= LAYOUT) {\n options.uniqueList.push(o);\n }\n else {\n // OFFSET的话先递归看子节点,本身改变放在最后\n let uniqueList = [];\n node.deepScan(function(child, uniqueList) {}, { uniqueList });\n uniqueList.forEach(item => {\n options.uniqueList.push(item);\n });\n options.uniqueList.push(o);\n\n }\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n // 按顺序执行列表即可,上层LAYOUT先执行停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n uniqueList.forEach(item => {\n let { node, lv } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n if(lv >= LAYOUT) {\n let isLastAbs = node.computedStyle.position === 'absolute';\n let isNowAbs = node.currentStyle.position === 'absolute';\n let parent = node.domParent;\n let { layoutData: { x, y, w, h }, width, computedStyle } = parent;\n let ref;\n if(ref = node.prev) {\n y = ref.y;\n y += ref.outerHeight;\n }\n else {\n y = parent.y;\n y += computedStyle.marginTop + computedStyle.borderTopWidth + computedStyle.paddingTop;\n }\n x += computedStyle.marginLeft + computedStyle.borderLeftWidth + computedStyle.paddingLeft;\n let { outerWidth, outerHeight } = node;\n let change2Abs;\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n if(isNowAbs) {\n while(container.isShadowRoot) {\n container = container.host; // 先把可能递归嵌套的组件循环完\n }\n container = container.parent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute) {\n break;\n }\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n parent.__layoutAbs(container, null, node);\n // 一直abs无需偏移后面兄弟\n if(isLastAbs) {\n return;\n }\n change2Abs = true;\n }\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n if(node instanceof Dom) {\n if(!node.parent && node.host) {\n container = node; // 特殊判断component的sr为container\n }\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n // 记录重新布局引发的差值w/h,注意abs到非abs的切换情况\n let fromAbs = node.computedStyle.position === 'absolute';\n let dx, dy;\n if(change2Abs) {\n dx = -outerWidth;\n dy = -outerHeight;\n }\n else {\n let { outerWidth: ow, outerHeight: oh } = node;\n if(fromAbs) {\n dx = ow;\n dy = oh;\n }\n else {\n dx = ow - outerWidth;\n dy = oh - outerHeight;\n }\n }\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需递归,因为已经包含了\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle.position === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n // 如果有差值,偏移next兄弟,同时递归向上所有parent扩充和next偏移,直到absolute的中止\n if(dx || dy) {\n let p = node;\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(p.isShadowRoot) {\n p = p.host;\n }\n last = p;\n // 先偏移next,忽略有定位的absolute或LAYOUT\n let next = p.next;\n while(next) {\n if(next.currentStyle.position === 'absolute') {\n if(next.currentStyle.top.unit === AUTO && next.currentStyle.bottom.unit === AUTO) {\n next.__offsetY(dy, true, level.REFLOW);\n next.__cancelCache();\n }\n }\n else if(!next.hasOwnProperty('____uniqueReflowId') || reflowHash[next.____uniqueReflowId] < LAYOUT) {\n next.__offsetY(dy, true, level.REFLOW);\n next.__cancelCache();\n }\n next = next.next;\n }\n // 要么一定有parent,因为上面向上循环排除了cp返回cp的情况;要么就是root本身\n p = p.parent;\n if(p === root) {\n break;\n }\n // parent判断是否要resize\n let { currentStyle } = p;\n let isAbs = currentStyle.positoin === 'absolute';\n if(dx) {\n let need;\n // width在block不需要,parent一定不会是flex/inline\n if(isAbs) {\n if(currentStyle.width.unit === AUTO\n && (currentStyle.left.unit === AUTO || currentStyle.right.unit === AUTO)) {\n need = true;\n }\n }\n if(need) {\n p.__resizeX(dx);\n p.__cancelCache();\n p.__refreshLevel |= level.REFLOW;\n }\n }\n if(dy) {\n let need;\n if(isAbs) {\n if(currentStyle.height.unit === AUTO\n && (currentStyle.top.unit === AUTO || currentStyle.bottom.unit === AUTO)) {\n need = true;\n }\n }\n // height则需要\n else if(currentStyle.height.unit === AUTO) {\n need = true;\n }\n if(need) {\n p.__resizeY(dy);\n p.__cancelCache();\n p.__refreshLevel |= level.REFLOW;\n }\n // 高度不需要调整提前跳出\n else {\n break;\n }\n }\n }\n while(true);\n // 最后一个递归向上取消缓存,防止过程中重复next多次无用递归\n while(last) {\n last.__cancelCache();\n last = last.domParent;\n }\n }\n }\n // OFFSET操作的节点都是relative,要考虑auto变化\n else {\n let {\n currentStyle: { top, right, bottom, left }, currentStyle,\n computedStyle: { top: t, right: r, bottom: b, left: l }, computedStyle,\n } = node;\n let parent;\n if(node === this) {\n parent = node;\n }\n else {\n parent = node.domParent;\n }\n let newY = 0;\n if(top.unit !== AUTO) {\n newY = calRelative(currentStyle, 'top', top, parent);\n computedStyle.top = newY;\n computedStyle.bottom = 'auto';\n }\n else if(bottom.unit !== AUTO) {\n newY = -calRelative(currentStyle, 'bottom', bottom, parent);\n computedStyle.bottom = -newY;\n computedStyle.top = 'auto';\n }\n else {\n computedStyle.top = computedStyle.bottom = 'auto';\n }\n let oldY = 0;\n if(t !== 'auto') {\n oldY = t;\n }\n else if(b !== 'auto') {\n oldY = -b;\n }\n if(newY !== oldY) {\n node.__offsetY(newY - oldY, false, level.REFLOW);\n }\n let newX = 0;\n if(left.unit !== AUTO) {\n newX = calRelative(currentStyle, 'left', left, parent);\n computedStyle.left = newX;\n computedStyle.right = 'auto';\n }\n else if(right.unit !== AUTO) {\n newX = -calRelative(currentStyle, 'right', right, parent);\n computedStyle.right = -newX;\n computedStyle.left = 'auto';\n }\n else {\n computedStyle.left = computedStyle.right = 'auto';\n }\n let oldX = 0;\n if(l !== 'auto') {\n oldX = l;\n }\n else if(r !== 'auto') {\n oldX = -r;\n }\n if(newX !== oldX) {\n node.__offsetX(newX - oldX, false, level.REFLOW);\n }\n }\n });\n reflowList.forEach(item => delete item.node.__uniqueReflowId);\n return [reflowList, uniqueList];\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n\n get dom() {\n return this.__dom;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get 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 Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k])) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n originX,\n originY,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n let rebuild = this.buildCache(originX, originY);\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n d = painter.svgLine(x1, y1, x2, y2, controlA, controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS) {\n if(strokeWidth > 0) {\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve, dx, dy);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, curve, dx, dy);\n }\n ctx.stroke();\n ctx.closePath();\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get x1() {\n return this.getProps('x1');\n }\n\n get y1() {\n return this.getProps('y1');\n }\n\n get x2() {\n return this.getProps('x2');\n }\n\n get y2() {\n return this.getProps('y2');\n }\n\n get controlA() {\n return this.getProps('controlA');\n }\n\n get controlB() {\n return this.getProps('controlB');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n sx, sy,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n },\n isMulti, __cacheProps,\n } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 2;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n buildCache(originX, originY) {\n let { width, height, points, controls, start, end, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.points)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n if(isNil(__cacheProps.start)) {\n rebuild = true;\n __cacheProps.start = start;\n }\n if(isNil(__cacheProps.end)) {\n rebuild = true;\n __cacheProps.end = end;\n }\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = points.filter(item => Array.isArray(item)).map((item, i) => {\n let cl = controls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n __cacheProps.len = getLength(__cacheProps.list, isMulti);\n }\n else {\n __cacheProps.list = points.filter(item => Array.isArray(item)).map((point, i) => {\n if(i) {\n return concatPointAndControl(point, controls[i - 1]);\n }\n return point;\n });\n __cacheProps.len = getLength(__cacheProps.list, isMulti);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n originX,\n originY,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fillRule,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(originX, originY);\n let list = __cacheProps.list;\n if(isMulti) {\n __cacheProps.list2 = list.map((item, i) => {\n if(Array.isArray(item)) {\n let len = __cacheProps.len;\n return getNewList(item, {\n list: len.list[i],\n total: len.total[i],\n increase: len.increase[i],\n }, __cacheProps.start[i], __cacheProps.end[i]);\n }\n });\n }\n else {\n __cacheProps.list2 = getNewList(list, __cacheProps.len, __cacheProps.start, __cacheProps.end);\n }\n if(renderMode === mode.SVG) {\n if(isMulti) {\n let d = '';\n __cacheProps.list2.forEach(item => d += painter.svgPolygon(item));\n __cacheProps.d = d;\n }\n else {\n __cacheProps.d = painter.svgPolygon(__cacheProps.list2);\n }\n }\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.list2.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, __cacheProps.list2, dx, dy);\n }\n ctx.fill(fillRule === 'evenodd' ? fillRule : 'nonzero');\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['d', __cacheProps.d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n if(fillRule === 'evenodd') {\n props.push(['fill-rule', 'evenodd']);\n }\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get points() {\n return this.getProps('points');\n }\n\n get controls() {\n return this.getProps('controls');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], xb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], xb + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n return bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction getCoordsByDegree(x, y, r, d) {\n r = Math.max(r, 0);\n d = d % 360;\n if(d >= 0 && d < 90) {\n return [\n x + Math.sin(d * Math.PI / 180) * r,\n y - Math.cos(d * Math.PI / 180) * r\n ];\n }\n else if(d >= 90 && d < 180) {\n return [\n x + Math.cos((d - 90) * Math.PI / 180) * r,\n y + Math.sin((d - 90) * Math.PI / 180) * r,\n ];\n }\n else if(d >= 180 && d < 270) {\n return [\n x - Math.cos((270 - d) * Math.PI / 180) * r,\n y + Math.sin((270 - d) * Math.PI / 180) * r,\n ];\n }\n else {\n return [\n x - Math.sin((360 - d) * Math.PI / 180) * r,\n y - Math.cos((360 - d) * Math.PI / 180) * r,\n ];\n }\n}\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin)) {\n rebuild = true;\n __cacheProps.begin = begin;\n }\n if(isNil(__cacheProps.end)) {\n rebuild = true;\n __cacheProps.end = end;\n }\n if(isNil(__cacheProps.r)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge)) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure)) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.x1 = [];\n __cacheProps.x2 = [];\n __cacheProps.y1 = [];\n __cacheProps.y2 = [];\n __cacheProps.large = [];\n __cacheProps.d = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let [x1, y1] = getCoordsByDegree(cx, cy, r2, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r2, end[i] || 0);\n let large = ((end[i] || 0) - begin) > 180 ? 1 : 0;\n __cacheProps.x1.push(x1);\n __cacheProps.x2.push(x2);\n __cacheProps.y1.push(y1);\n __cacheProps.y2.push(y2);\n __cacheProps.large.push(large);\n });\n }\n else {\n let [x1, y1] = getCoordsByDegree(cx, cy, r, begin);\n let [x2, y2] = getCoordsByDegree(cx, cy, r, end);\n let large = (end - begin) > 180 ? 1 : 0;\n __cacheProps.x1 = x1;\n __cacheProps.x2 = x2;\n __cacheProps.y1 = y1;\n __cacheProps.y2 = y2;\n __cacheProps.large = large;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n cx,\n cy,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { width, __cacheProps, isMulti } = this;\n this.buildCache(cx, cy);\n let { begin, end, r, x1, y1, x2, y2, edge, large, closure } = __cacheProps;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n begin.forEach((begin, i) => painter.canvasSector(ctx, cx, cy, r[i], x1[i], y1[i], x2[i], y2[i],\n strokeWidth, begin[i], end[i], large[i], edge[i], closure[i], dx, dy));\n }\n else {\n painter.canvasSector(ctx, cx, cy, r, x1, y1, x2, y2, strokeWidth, begin, end, large, edge, closure, dx, dy);\n }\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n this.__genSector(edge[i],\n painter.svgSector(cx, cy, r2, x1[i], y1[i], x2[i], y2[i], strokeWidth, large[i], edge[i], closure[i]),\n fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit\n );\n });\n }\n else {\n this.__genSector(edge,\n painter.svgSector(cx, cy, r, x1, y1, x2, y2, strokeWidth, large, edge, closure),\n fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit\n );\n }\n }\n return res;\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get edge() {\n return this.getProps('edge');\n }\n\n // >180°时是否链接端点\n get closure() {\n return this.getProps('closure');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n return bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\nimport util from \"../util/util\";\n\nlet { isNil } = util;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n originX,\n originY,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(originX, originY);\n let list = __cacheProps.list;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, list, dx, dy);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += painter.svgPolygon(item));\n }\n else {\n d = painter.svgPolygon(list);\n }\n let props = [\n ['d', d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n let { sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.min(bbox[2], originX + width + ox);\n bbox[3] = Math.min(bbox[3], originY + height + oy);\n return bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r)) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n cx,\n cy,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(cx, cy);\n let list = __cacheProps.list;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, list, dx, dy);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += painter.svgPolygon(item));\n }\n else {\n d = painter.svgPolygon(list);\n }\n let props = [\n ['d', d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n return bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport mode from '../node/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport geom from '../math/geom';\n\nlet { isNil } = util;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, defs) {\n let res = super.render(renderMode, lv, ctx, defs);\n if(res.break) {\n return res;\n }\n let {\n cx,\n cy,\n fill,\n stroke,\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n this.buildCache(cx, cy);\n let list = __cacheProps.list;\n if(renderMode === mode.CANVAS) {\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n painter.canvasPolygon(ctx, list, dx, dy);\n }\n ctx.fill();\n if(strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += painter.svgPolygon(item));\n }\n else {\n d = painter.svgPolygon(list);\n }\n let props = [\n ['d', d],\n ['fill', fill],\n ['stroke', stroke],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps,\n sx, sy, width, height,\n currentStyle: {\n boxShadow,\n filter,\n },\n computedStyle: {\n borderTopWidth,\n borderLeftWidth,\n marginTop,\n marginLeft,\n paddingTop,\n paddingLeft,\n strokeWidth,\n } } = this;\n let originX = sx + borderLeftWidth + marginLeft + paddingLeft;\n let originY = sy + borderTopWidth + marginTop + paddingTop;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = strokeWidth * 0.5;\n let [ox, oy] = this.__spreadByBoxShadowAndFilter(boxShadow, filter);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n return bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n};\n\nlet abbrCssProperty = {\n os: 'offset',\n e: 'easing',\n ft: 'filter',\n bd: 'boxShadow',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET).forEach(item => {\n let k = item.k;\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(target, vars) {\n if(target && vars) {\n Object.keys(target).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = target[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n console.error('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 只需将可能存在的children在遍历link一遍即可,如果children里有递归,前面因为出现过已经link过了\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let { id, children } = item;\n if(Array.isArray(children)) {\n children.forEach(child => {\n // 排除原始类型文本\n if(!isPrimitive(child)) {\n let { libraryId } = child;\n // ide中库文件的child来自于库一定有libraryId,但是为了编程特殊需求,放开允许存入自定义数据\n if(isNil(libraryId)) {\n return;\n }\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,属性和子图层来自库\n if(libraryItem) {\n linkChild(child, libraryItem);\n }\n else {\n throw new Error('Link library item miss libraryId: ' + libraryId);\n }\n }\n });\n }\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, vars, hash = {}) {\n if(isPrimitive(json) || json instanceof Node) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, vars, hash);\n });\n }\n let { library, libraryId } = json;\n // 有library说明是个mc节点,不会有init/animate和children链接,是个正常节点\n if(Array.isArray(library)) {\n hash = {};\n // 强制要求library的文件是排好顺序的,即元件和被引用类型在前面,引用的在后面,\n // 另外没有循环引用,没有递归library,先遍历设置引用,再递归进行连接\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 删除以免二次解析,有library一定没libraryId\n json.library = null;\n json.libraryId = null;\n }\n // ide中库文件的child一定有libraryId,有library时一定不会有libraryId\n else if(!isNil(libraryId) && hash) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n }\n let { tagName, props = {}, children = [], animate = [], __animateRecords } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, vars);\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else {\n vd = karas.createVd(tagName, props, children.map((item, i) => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, vars, hash);\n }));\n }\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n }\n let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n abbr2full(item, abbrCssProperty);\n replaceVars(item, vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n abbr2full(options, abbrAnimateOption);\n replaceVars(options, vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport Controller from '../animate/Controller';\n\nexport default {\n parse(karas, json, dom, options = {}) {\n json = util.clone(json);\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options.vars);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__auto = ac.__auto.concat(animateRecords);\n ac.__playAuto();\n }\n else {\n ac.__records = ac.__records.concat(animateRecords);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n abbr,\n};\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\n\nexport default {\n css,\n reset,\n unit,\n font,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './geom/Geom';\nimport Line from './geom/Line';\nimport Polyline from './geom/Polyline';\nimport Polygon from './geom/Polygon';\nimport Sector from './geom/Sector';\nimport Rect from './geom/Rect';\nimport Circle from './geom/Circle';\nimport Ellipse from './geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\nupdater.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\n\nexport default karas;\n"],"names":["Node","__x","__y","__ox","__oy","__width","__height","__baseLine","diff","isLayout","__isDestroyed","x","ox","y","oy","__prev","__next","__parent","__domParent","undefined","p","root","parent","host","__root","__host","__virtualDom","CANVAS","SVG","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","arial","lhr","car","blr","TYPE_VD","_","TYPE_GM","TYPE_CP","identity","multiply","a","b","isPreIdA","isPreIdB","isSubIdA","isSubIdB","slice","c","calPoint","point","m","d","e","f","int2convolution","v","Math","floor","sqrt","PI","inverse","ar","br","cr","dr","er","fr","toString","isType","type","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","isNil","joinSourceArray","arr","res","i","len","length","item","Array","isArray","stringify","s","encodeHtml","prop","replace","joinVirtualDom","vd","defs","forEach","joinDef","bbClip","bb","joinVd","conClip","children","isMask","isClip","props","tagName","content","opacity","transform","visibility","mask","clip","filter","def","uuid","joinItem","rgba2int","color","charAt","push","parseInt","match","parseFloat","int2rgba","joinArr","arr2hash","hash","list","Object","keys","j","k","hash2arr","clone","$$type","util","Date","n","equalArr","ai","bi","isArrayA","isArrayB","equal","hasOwnProperty","getTime","extend","target","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__target","assigning","finished","__stayEnd","assignCurrentStyle","transformBbox","bbox","matrix","dx","dy","x1","y1","x2","y2","mx","xa","ya","xb","yb","min","max","isPrimitive","isAuto","position","gradient","img","H","vectorProduct","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","angleBySide","theta","pow","acos","pointsDistance","triangleIncentre","x3","y3","ellipsePoints","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","transformOrigin","calPercentInNode","ds","atan","d1","deg","Infinity","dt","d2","cos","sin","d2r","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","t","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","l","r","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","abs","bezierLength","points","startT","endT","at","at3","p0","p1","p2","p3","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","p4","x12","y12","x23","y23","x123","y123","x4","y4","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","end","reverse","h","unit","geom","getLinearDeg","exec","getRadialPosition","data","test","value","top","left","center","right","bottom","getColorStop","num","per","prev","allBefore","allAfter","first","last","getCsLimit","next","c1","c2","getCsStartLimit","getCsEndLimit","calLinearCoords","calRadialRadius","shape","size","iw","ih","xl","yl","r1","g1","b1","a1","r2","g2","b2","a2","l1","l2","g","parseGradient","reg","o","toLowerCase","indexOf","z","map","getLinear","w","stop","getRadial","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","fontFamily","fontStyle","fontWeight","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","justifyContent","alignItems","alignSelf","textAlign","zIndex","translateX","translateY","scaleX","scaleY","skewX","skewY","rotateZ","boxShadow","pointerEvents","GEOM","fill","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","fillRule","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","style","grow","shrink","basis","parseMarginPadding","key","temp","parseOneBorder","margin","padding","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","background","backgroundPosition","flex","translate","scale","rotate","skew","toFull","gd","repeat","bgc","join","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","KEY_EXPAND","EXPAND_HASH","IGNORE","REPAINT","MEASURE","isIgnore","isRepaint","isGeom","isMeasure","addGeom","ks","reset","MEASURE_KEY_SET","isMeasureInherit","measureInheritList","DEFAULT_FONT_SIZE","calUnit","compatibleTransform","normalize","abbr","console","error","bc","arr1","arr2","tfo","isNaN","blur","computeMeasure","isHost","currentStyle","parentComputedStyle","change","computeReflow","isRoot","calNormalLineHeight","setFontStyle","getBaseLine","normal","font","calRelativePercent","calRelative","isWidth","calAbsolute","equalStyle","oa","ob","av","bv","isMulti","isRelativeOrAbsolute","direct","LineBox","__content","renderMode","ctx","cacheStyle","css","mode","fillText","Text","__lineBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","wait","MEASURE_TEXT","cache","CHAR_WIDTH_CACHE","needMeasure","char","mw","charWidth","measureText","isVirtual","isDestroyed","lineBoxes","begin","count","maxW","lineBox","__offsetX","__offsetY","textWidth","__layout","lv","fillStyle","render","virtualDom","cb","baseLine","__cacheStyle","prototype","__renderByMask","canvasPolygon","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","svgLine","OFFSET","canvasSector","large","edge","closure","arc","svgSector","calDeg","pointIndex","index","cross","pointByIndex","exchangeOrder","sx1","sy1","sx2","sy2","sx3","sy3","tx1","ty1","tx2","ty2","tx3","ty3","isOverflow","cross1","cross2","overflow","ls","lt","alpha","ls2","lt2","ax2","ay2","ax3","ay3","ab","ac","AB","AC","BC","A","tan","tar","math","calSingle","calMatrix","ow","oh","calMatrixByOrigin","t2","calMatrixWithOrigin","pointInQuadrilateral","normalizeSingle","calOrigin","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","free","mo","calDashed","m1","m2","m3","m4","bw","calPoints","deg1","deg2","direction","beginRadius","endRadius","isLast","main1","main2","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","beginLength","needInner","crossDeg","rx1","ry1","oyl","rx2","ry2","ca","calBezierTopLeft","controls1","controls2","limit","concat","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btw","brw","bbw","blw","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","VERTEX","FRAGMENT","initShaders","gl","vshader","fshader","program","createProgram","useProgram","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","initVertexBuffers","vertices","Float32Array","vertexBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","STATIC_DRAW","FSIZE","BYTES_PER_ELEMENT","aPosition","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","aTexCoord","projectionMatrix","getUniformLocation","uniformMatrix3fv","initLocation","uSampler","uOffset","uClamp","createAndSetupTexture","texture","createTexture","bindTexture","TEXTURE_2D","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","NEAREST","TEXTURE_MAG_FILTER","KawaseBlurFilter","webgl","quality","pixelStorei","UNPACK_FLIP_Y_WEBGL","vertexLocations","textureLocations","_pixelSize","pixelSize","_kernels","_blur","textures","framebuffers","texImage2D","UNSIGNED_BYTE","fbo","createFramebuffer","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","image","uOffsetArray","clear","uniform2f","viewport","uniform4f","drawArrays","TRIANGLE_STRIP","initBuffers","uniform1i","originalImageTexture","canvas","uvX","uvY","offset","_quality","draw","clearRect","drawImage","kernels","step","clearColor","COLOR_BUFFER_BIT","apply","round","_generateKernels","gaussBlur","SPF","WEBGL","document","createElement","setAttribute","karas","debug","body","appendChild","getContext","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","inject","html","chars","inline","div","innerHTML","cns","childNodes","window","getComputedStyle","text","__measureCb","removeChild","measureImg","url","state","task","Image","onload","success","onerror","substr","location","hostname","crossOrigin","src","warn","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","delCacheWebgl","isDom","Element","getElementsByTagName","Event","__eHash","handle","self","on","off","__karasEventCb","once","emit","event","fns","fn","traversal","before","after","isPause","Frame","__hookTask","__task","__taskBF","__now","taskBF","cloneBF","__init","animate","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","B","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","Error","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","unify","frames","currentProps","inherit","outerWidth","outerHeight","tf","genBeforeRefresh","animation","__addUpdate","__style","__assigning","__frameHook","framing","duration","es","time","transition","calDiff","pm","nm","pi","ni","pv","nv","innerWidth","eq","pp","np","v2","len2","pv2","nv2","v3","len3","pv3","nv3","calFrame","ts","binarySearch","frame","middle","getEasing","ea","timingFunction","steps","stepsD","ceil","calIntermediateStyle","o2","n2","st2","gotoOverload","options","lastCurrentTime","lastNextTime","Animation","__id","__list","nl","__options","op","__duration","delay","endDelay","iterations","fps","playbackRate","__easing","__playCount","spfLimit","__frames","__framesR","__startTime","currentTime","__nextTime","__fpsTime","__playState","current","unshift","copy","__keys","__originStyle","framesR","isFinish","__cancelTask","restore","__currentTime","__currentFrames","__currentFrame","__currentProps","__currentStyle","__hasFin","__begin","__end","__isDelay","__finish","__inFps","__enterFrame","FINISH","isDelay","FRAME","__firstPlay","PLAY","__playCb","playState","__hasCancel","firstEnter","is2","lastI","lastFrame","endTime","endTimeR","isAlternate","alternate","cfs","stayEnd","stayBegin","__stayBegin","enterFrame","playCount","currentFrames","__calDiffTime","isLastFrame","isLastCount","inEndDelay","__nextBegin","__clean","__frameCb","BEGIN","END","isEven","__fin","silence","pending","PAUSE","play","addRefreshTask","CANCEL","__goto","isFrame","excludeDelay","finish","spf","animateController","add","remove","backwards","both","forwards","sync","removeControl","nextFrame","__delay","__endDelay","__fps","__iterations","__fill","pause","resume","__direction","__playbackRate","__spfLimit","ENUM","NONE","TRANSLATE_X","TRANSLATE_Y","TRANSFORM","OPACITY","FILTER","VISIBILITY","REFLOW","TRANSFORMS","assign","contain","getLevel","isReflow","SIZE","MAX","HASH","Page","number","__size","__number","__free","__total","offScreen","__canvas","__offScreen","__grid","grid","pos","page","Cache","__bbox","__page","__pos","getCoords","__coords","__enabled","setTransform","globalAlpha","beginPath","rect","closePath","coords","xc","yc","dbx","dby","enabled","__available","del","getInstance","cacheFilter","old","newCache","nx","ny","dbx2","dby2","cacheMask","genMask","__cacheFilter","__cache","__opacity","drawCache","globalCompositeOperation","painter","TRANSFORM_ALL","level","renderBorder","xom","renderBgc","method","borderRadiusKs","calBorderRadius","noRadius","half","calBackgroundSize","calBackgroundPosition","container","renderBoxShadow","spread","inset","box","save","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","empty","Xom","__tagName","__computedStyle","__listener","__refreshLevel","listener","__loadBgi","__mpWidth","mp","fromAbs","__cancelCache","__layoutData","__mp","__layoutFlex","__layoutInline","__layoutBlock","__animateRecords","controller","autoPlay","__records","__auto","__playAuto","w2","h2","fixedWidth","fixedHeight","innerHeight","matrixCache","isScale","__matrix","loadBgi","delRefreshTask","focus","__gradient","k2","kw","__hasContent","cacheTotal","__cacheTotal","displayNone","canCache","displayAnimating","__lastDisplay","__blurValue","__sx","__sy","__calCache","domParent","matrixEvent","__matrixEvent","updateCache","visibilityAnimating","availableAnimating","hasContent","renderMatrix","__renderMatrix","__cacheMask","isImg","__appendData","bgX","bgY","needMask","xnl","xnr","ynt","ynb","needResize","__hasMask","__hasClip","isEmpty","sibling","mChildren","isTop","ref","owner","__destroy","force","__stopPropagation","__stopImmediatePropagation","willResponseEvent","inThis","__touchstartTarget","vs","__getLg","__getRg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","os","hasChange","origin","overwrite","cancel","layoutData","__spreadByBoxShadowAndFilter","animating","currentFrame","LineGroup","__calBaseLine","TAG_NAME","INLINE","BOLD","Dom","Img","Geom","Component","initRoot","cd","flattenJson","build","relation","initCp","json","hasP","klass","placeholder","__children","getRegister","traverseJson","lastText","shadowRoot","setUpdateFlag","cp","__hasUpdate","constructor","__ref","__state","__isMounted","__nextState","builder","__cd","__shadow","__shadowRoot","componentDidMount","REFRESH","componentWillUnmount","__emitEvent","__computeMeasure","defineProperty","get","ROOT","TOP","CHILD","REGISTER","__isMulti","multi","__isMask","__isClip","__cacheProps","isDirectionRow","main","__preLayout","__marginAuto","originX","originY","strokeDasharrayStr","strokeStyle","lineWidth","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preData","__preSet","__preSetCanvas","cacheTop","refreshMode","recursion","name","hasRegister","genZIndexChildren","dom","flow","needSort","lastIndex","child","__iIndex","__zIndex","sort","getMaskChildren","__lineGroups","block","none","tag","flowChildren","__tryLayInline","isRecursion","__calAutoBasis","min2","max2","__calMp","lineGroups","cw","lineGroup","fw","verticalAlign","horizonAlign","growList","shrinkList","basisList","minList","growSum","shrinkSum","basisSum","maxSum","maxCross","between","around","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__layoutAbs","blurValue","__mergeBbox","genOffScreenBlur","__noChildMask","hasMask","__renderAsMask","canCacheChildren","zIndexChildren","__zIndexChildren","maskChildren","__maskChildren","lv2","newCtx","ignoreGeom","offScreen2","hasMC","hasClip","drawMask","canCacheSelf","effectiveAnimating","isShadowRoot","__applyCache","bboxTotal","deepScan","loadImg","__loadImg","pts","__addGeom","Defs","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","shadow","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","nc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","oClip","nClip","isText","svg","where","insertBefore","Controller","args","init","__action","__set","getDom","querySelector","renderProp","initEvent","addEventListener","__wrapEvent","__cb","isFixedWidthOrHeight","isFixedSize","LAYOUT","isLAYOUT","__uniqueReflowId","setLAYOUT","addLAYOUT","uniqueUpdateId","parseUpdate","updateHash","reflowList","measureList","cacheHash","cacheList","measure","hasMeasure","hasZ","__uniqueUpdateId","Root","__dom","__mw","__mh","__scx","__scy","__updateList","__updateHash","__reflowList","__animateController","mix","getBoundingClientRect","touches","pageX","pageY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","toUpperCase","__genHtml","__uuid","__defs","getPropertyValue","__ctx","__renderMode","refresh","destroy","isFirst","__checkRoot","__checkUpdate","__checkReflow","__clear","__vd","__rTask","setStateList","updater","hookTask","positoin","__updateRoot","updateRoot","hasUpdate","measureHash","isInherit","hasRoot","reflowHash","checkInfluence","onlyXY","uniqueList","isLastAbs","isNowAbs","change2Abs","____uniqueReflowId","isAbs","__resizeX","__resizeY","newY","oldY","newX","oldX","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","rebuild","buildCache","curve","__propsStrokeStyle","getProps","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","Polyline","__points","__controls","controls","isControl","__getPoints","cl","list2","pointList","controlList","Polygon","getCoordsByDegree","getR","dft","Sector","__r","__edge","__closure","__genSector","genVertex","rx","ry","Rect","__rx","__ry","Circle","Ellipse","my","fullCssProperty","abbrCssProperty","ft","bd","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","fk","replaceVars","vars","linkLibrary","libraryId","libraryItem","linkChild","JSON","parse","animateRecords","library","createGm","createVd","animationRecord","has","register","version","appendTo","createCp","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAMA;EACJ,kBAAc;EAAA;;EACZ,SAAKC,GAAL,GAAW,CAAX;EACA,SAAKC,GAAL,GAAW,CAAX;EACA,SAAKC,IAAL,GAAY,CAAZ,CAHY;;EAIZ,SAAKC,IAAL,GAAY,CAAZ;EACA,SAAKC,OAAL,GAAe,CAAf;EACA,SAAKC,QAAL,GAAgB,CAAhB;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AAAA,GAAG,EAAHA,KAnEU;EAoEVmP,EAAAA,IAAI,EAAJA,IApEU;EAqEVlqB,EAAAA,KAAK,EAALA,KArEU;EAsEVhzB,EAAAA,IAAI,EAAJA,IAtEU;EAuEVowB,EAAAA,MAAM,EAANA,MAvEU;EAwEV3c,EAAAA,KAAK,EAALA,KAxEU;EAyEV0yC,EAAAA,MAAM,EAANA,MAzEU;EA0EV3xB,EAAAA,OAAO,EAAPA,OA1EU;EA2EV9U,EAAAA,IAAI,EAAJA,IA3EU;EA4EVgwB,EAAAA,OAAO,EAAPA,OA5EU;EA6EV8P,EAAAA,OAAO,EAAPA,OA7EU;EA8EVV,EAAAA,OAAO,EAAPA;EA9EU,CAAZ;EAiFApP,OAAO,CAAC1D,GAAR,CAAY;EACVzE,EAAAA,GAAG,EAAHA,GADU;EAEVwG,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;EAOAsR,OAAO,CAACxT,GAAR,CAAY;EACVzE,EAAAA,GAAG,EAAHA,GADU;EAEVwG,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAOtd,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACrB,KAAP,GAAeA,OAAf;EACD;;;;;;;;"} \ No newline at end of file diff --git a/src/animate/Animation.js b/src/animate/Animation.js index 44221924e..8fa41ab3a 100644 --- a/src/animate/Animation.js +++ b/src/animate/Animation.js @@ -710,7 +710,7 @@ function getEasing(ea) { * @returns {*} */ function calIntermediateStyle(frame, percent, target) { - let style = clone(frame.style); + let style = css.clone(frame.style); let timingFunction = getEasing(frame.easing); if(timingFunction && timingFunction !== linear) { percent = timingFunction(percent); diff --git a/src/style/css.js b/src/style/css.js index 9a0f9225c..f31b4c1b0 100644 --- a/src/style/css.js +++ b/src/style/css.js @@ -802,6 +802,7 @@ function computeReflow(node, isHost) { 'flexDirection', 'justifyContent', 'alignItems', + 'alignSelf', 'flexGrow', 'flexShrink', ].forEach(k => { @@ -987,6 +988,45 @@ function isRelativeOrAbsolute(node) { return position === 'relative' || position === 'absolute'; } +let direct = { + position: true, + display: true, + backgroundSize: true, + backgroundRepeat: true, + borderTopStyle: true, + borderRightStyle: true, + borderBottomStyle: true, + borderLeftStyle: true, + flexDirection: true, + justifyContent: true, + alignItems: true, + alignSelf: true, + flexGrow: true, + flexShrink: true, + strokeLinecap: true, + strokeLinejoin: true, + strokeMiterlimit: true, + fillRule: true, +}; +function clone(style) { + let res = {}; + for(let k in style) { + if(style.hasOwnProperty(k)) { + let v = style[k]; + if(direct.hasOwnProperty(k)) { + res[k] = v; + } + else if(k === 'filter' || k === 'transform' || k === 'strokeDasharray') { + res[k] = util.extend({}, v); + } + else { + res[k] = util.extend({}, v, ['value', 'unit']); + } + } + } + return res; +} + export default { normalize, computeMeasure, @@ -997,4 +1037,5 @@ export default { calAbsolute, equalStyle, isRelativeOrAbsolute, + clone, };