From 6e789867ed2e615ffc9302952790f1a2f5b2e41a Mon Sep 17 00:00:00 2001 From: 0JARVIS0 <709406687@qq.com> Date: Fri, 29 Nov 2019 12:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=A1=86=EF=BC=8C=E5=A2=9E=E5=8A=A0movingcac?= =?UTF-8?q?he=E6=9B=B4=E6=96=B0=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- painter.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/painter.js b/painter.js index 7d504a4..e64acc9 100644 --- a/painter.js +++ b/painter.js @@ -15,6 +15,7 @@ Component({ paintCount: 0, currentPalette: {}, movingCache: {}, + needClear: false, /** * 组件的属性列表 */ @@ -60,7 +61,9 @@ Component({ type: Object, observer: function (newVal, oldVal) { if (newVal) { - this.doAction(newVal) + this.doAction(newVal, (callbackInfo) => { + this.movingCache = callbackInfo + }) } }, }, @@ -72,7 +75,21 @@ Component({ frontStyle: style }) } - } + }, + clearActionBox: { + type: Boolean, + observer: function (needClear) { + if (needClear && !this.needClear) { + if (this.frontContext) { + this.frontContext.draw() + this.touchedView = {}; + this.prevFindedIndex = this.findedIndex + this.findedIndex = -1; + } + } + this.needClear = needClear + } + }, }, data: {