fix: view.rect 存在时不覆盖

This commit is contained in:
CPPAlien 2019-12-25 14:39:47 +08:00
parent 617d92f224
commit 2e9a0852cf

View File

@ -359,14 +359,23 @@ export default class Painter {
} else if (verticalAlign === 'bottom') {
top = y - height
}
view.rect = {
left: left,
top: top,
right: left + width,
bottom: top + height,
x: view.css && view.css.right ? x - width : x,
y: y
};
if (view.rect) {
view.rect.left = left;
view.rect.top = top;
view.rect.right = left + width;
view.rect.bottom = top + height;
view.rect.x = view.css && view.css.right ? x - width : x;
view.rect.y = y;
} else {
view.rect = {
left: left,
top: top,
right: left + width,
bottom: top + height,
x: view.css && view.css.right ? x - width : x,
y: y
};
}
view.rect.left = view.rect.left - paddings[3];
view.rect.top = view.rect.top - paddings[0];