From 1712e7c926cfe72d2227704e7751a58a9e7269ac Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 20 Jul 2022 09:54:12 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2051=20fix=EF=BC=9Aconsole=20=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/@topology/core/src/core.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nezha-fronted/src/components/common/@topology/core/src/core.js b/nezha-fronted/src/components/common/@topology/core/src/core.js index ee4997280..88157997f 100644 --- a/nezha-fronted/src/components/common/@topology/core/src/core.js +++ b/nezha-fronted/src/components/common/@topology/core/src/core.js @@ -823,9 +823,11 @@ const Topology = /** @class */ (function () { this.setupMouseEvent() // Wait for parent dom load setTimeout(function () { + if (!_this.divLayer) return _this.canvasPos = _this.divLayer.canvas.getBoundingClientRect() }, 500) setTimeout(function () { + if (!_this.divLayer) return _this.canvasPos = _this.divLayer.canvas.getBoundingClientRect() }, 1000) this.cache() @@ -1300,6 +1302,9 @@ const Topology = /** @class */ (function () { return this } this.rendering = true + if (!this.offscreen ) { + return + } // 获取 ctx 对象 const ctx = this.offscreen.canvas.getContext('2d') ctx.clearRect(0, 0, this.offscreen.canvas.width, this.offscreen.canvas.height) @@ -2510,6 +2515,7 @@ const Topology = /** @class */ (function () { } this.cacheTimer = setTimeout(function () { let _a + if (!this.animateLayer) return _this.animateLayer.readyPlay(undefined, true) _this.animateLayer.animate(); (_a = _this.cache) === null || _a === void 0 ? void 0 : _a.call(_this)