1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"import { __extends } from \"tslib\";\nimport Displayble from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar m = [];\n\nvar IncrementalDisplayable = function (_super) {\n __extends(IncrementalDisplayable, _super);\n\n function IncrementalDisplayable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.notClear = true;\n _this.incremental = true;\n _this._displayables = [];\n _this._temporaryDisplayables = [];\n _this._cursor = 0;\n return _this;\n }\n\n IncrementalDisplayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n\n IncrementalDisplayable.prototype.useStyle = function () {\n this.style = {};\n };\n\n IncrementalDisplayable.prototype.getCursor = function () {\n return this._cursor;\n };\n\n IncrementalDisplayable.prototype.innerAfterBrush = function () {\n this._cursor = this._displayables.length;\n };\n\n IncrementalDisplayable.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.markRedraw();\n this.notClear = false;\n };\n\n IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\n this._temporaryDisplayables = [];\n };\n\n IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n } else {\n this._displayables.push(displayable);\n }\n\n this.markRedraw();\n };\n\n IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n };\n\n IncrementalDisplayable.prototype.getDisplayables = function () {\n return this._displayables;\n };\n\n IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\n return this._temporaryDisplayables;\n };\n\n IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n };\n\n IncrementalDisplayable.prototype.update = function () {\n this.updateTransform();\n\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n };\n\n IncrementalDisplayable.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n\n rect.union(childRect);\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n };\n\n IncrementalDisplayable.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n\n if (rect.contain(localPos[0], localPos[1])) {\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n return IncrementalDisplayable;\n}(Displayble);\n\nexport default IncrementalDisplayable;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/zrender/lib/graphic/IncrementalDisplayable.js"],"names":["__extends","Displayble","BoundingRect","m","IncrementalDisplayable","_super","_this","apply","arguments","notClear","incremental","_displayables","_temporaryDisplayables","_cursor","prototype","traverse","cb","context","call","useStyle","style","getCursor","innerAfterBrush","length","clearDisplaybles","markRedraw","clearTemporalDisplayables","addDisplayable","displayable","notPersistent","push","addDisplayables","displayables","i","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","update","updateTransform","parent","getBoundingRect","_rect","rect","Infinity","childRect","clone","needLocalTransform","applyTransform","getLocalTransform","union","contain","x","y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AA+B;AAC3B,iBAAO,IAAP;AACH;AACJ;AACJ;;AACD,WAAO,KAAP;AACH,GAZD;;AAaA,SAAOhD,sBAAP;AACH,CA1G6B,CA0G5BH,UA1G4B,CAA9B;;AA2GA,eAAeG,sBAAf","sourcesContent":["import { __extends } from \"tslib\";\r\nimport Displayble from './Displayable.js';\r\nimport BoundingRect from '../core/BoundingRect.js';\r\nvar m = [];\r\nvar IncrementalDisplayable = (function (_super) {\r\n __extends(IncrementalDisplayable, _super);\r\n function IncrementalDisplayable() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.notClear = true;\r\n _this.incremental = true;\r\n _this._displayables = [];\r\n _this._temporaryDisplayables = [];\r\n _this._cursor = 0;\r\n return _this;\r\n }\r\n IncrementalDisplayable.prototype.traverse = function (cb, context) {\r\n cb.call(context, this);\r\n };\r\n IncrementalDisplayable.prototype.useStyle = function () {\r\n this.style = {};\r\n };\r\n IncrementalDisplayable.prototype.getCursor = function () {\r\n return this._cursor;\r\n };\r\n IncrementalDisplayable.prototype.innerAfterBrush = function () {\r\n this._cursor = this._displayables.length;\r\n };\r\n IncrementalDisplayable.prototype.clearDisplaybles = function () {\r\n this._displayables = [];\r\n this._temporaryDisplayables = [];\r\n this._cursor = 0;\r\n this.markRedraw();\r\n this.notClear = false;\r\n };\r\n IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\r\n this._temporaryDisplayables = [];\r\n };\r\n IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\r\n if (notPersistent) {\r\n this._temporaryDisplayables.push(displayable);\r\n }\r\n else {\r\n this._displayables.push(displayable);\r\n }\r\n this.markRedraw();\r\n };\r\n IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\r\n notPersistent = notPersistent || false;\r\n for (var i = 0; i < displayables.length; i++) {\r\n this.addDisplayable(displayables[i], notPersistent);\r\n }\r\n };\r\n IncrementalDisplayable.prototype.getDisplayables = function () {\r\n return this._displayables;\r\n };\r\n IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\r\n return this._temporaryDisplayables;\r\n };\r\n IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n cb && cb(this._displayables[i]);\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n cb && cb(this._temporaryDisplayables[i]);\r\n }\r\n };\r\n IncrementalDisplayable.prototype.update = function () {\r\n this.updateTransform();\r\n for (var i = this._cursor; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\r\n var displayable = this._temporaryDisplayables[i];\r\n displayable.parent = this;\r\n displayable.update();\r\n displayable.parent = null;\r\n }\r\n };\r\n IncrementalDisplayable.prototype.getBoundingRect = function () {\r\n if (!this._rect) {\r\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n var childRect = displayable.getBoundingRect().clone();\r\n if (displayable.needLocalTransform()) {\r\n childRect.applyTransform(displayable.getLocalTransform(m));\r\n }\r\n rect.union(childRect);\r\n }\r\n this._rect = rect;\r\n }\r\n return this._rect;\r\n };\r\n IncrementalDisplayable.prototype.contain = function (x, y) {\r\n var localPos = this.transformCoordToLocal(x, y);\r\n var rect = this.getBoundingRect();\r\n if (rect.contain(localPos[0], localPos[1])) {\r\n for (var i = 0; i < this._displayables.length; i++) {\r\n var displayable = this._displayables[i];\r\n if (displayable.contain(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n return IncrementalDisplayable;\r\n}(Displayble));\r\nexport default IncrementalDisplayable;\r\n"]},"metadata":{},"sourceType":"module"} |