fix: 优化css覆盖机制
This commit is contained in:
parent
6c523d5a61
commit
aa1308cca4
@ -355,11 +355,6 @@ export default class Painter {
|
||||
view.rect.minWidth = view.css.fontSize.toPx() + pd[1] + pd[3];
|
||||
}
|
||||
|
||||
view.css.bottom = undefined
|
||||
view.css.right = undefined
|
||||
view.css.left = `${view.rect.x}px`
|
||||
view.css.top = `${view.rect.y}px`
|
||||
|
||||
this.ctx.rotate(angle);
|
||||
if (!notClip && view.css && view.css.borderRadius && view.type !== 'rect') {
|
||||
this._doClip(view.css.borderRadius, width, height, view.css.borderStyle);
|
||||
|
||||
@ -63,7 +63,7 @@ Component({
|
||||
if (newVal) {
|
||||
this.doAction(newVal, (callbackInfo) => {
|
||||
this.movingCache = callbackInfo
|
||||
})
|
||||
}, false, true)
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -220,7 +220,7 @@ Component({
|
||||
return deleteArea
|
||||
},
|
||||
|
||||
doAction(action, callback, isMoving) {
|
||||
doAction(action, callback, isMoving, overwrite) {
|
||||
let newVal = null
|
||||
if (action) {
|
||||
newVal = action.view
|
||||
@ -247,7 +247,9 @@ Component({
|
||||
return
|
||||
}
|
||||
if (newVal && newVal.css) {
|
||||
if (Array.isArray(doView.css) && Array.isArray(newVal.css)) {
|
||||
if (overwrite) {
|
||||
doView.css = newVal.css
|
||||
} else if (Array.isArray(doView.css) && Array.isArray(newVal.css)) {
|
||||
doView.css = Object.assign({}, ...doView.css, ...newVal.css)
|
||||
} else if (Array.isArray(doView.css)) {
|
||||
doView.css = Object.assign({}, ...doView.css, newVal.css)
|
||||
@ -598,6 +600,7 @@ Component({
|
||||
views: []
|
||||
}).paint();
|
||||
});
|
||||
this.touchedView = {};
|
||||
},
|
||||
|
||||
startPaint() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user