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') { } else if (verticalAlign === 'bottom') {
top = y - height top = y - height
} }
view.rect = { if (view.rect) {
left: left, view.rect.left = left;
top: top, view.rect.top = top;
right: left + width, view.rect.right = left + width;
bottom: top + height, view.rect.bottom = top + height;
x: view.css && view.css.right ? x - width : x, view.rect.x = view.css && view.css.right ? x - width : x;
y: y 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.left = view.rect.left - paddings[3];
view.rect.top = view.rect.top - paddings[0]; view.rect.top = view.rect.top - paddings[0];