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: {