fix: view.rect 存在时不覆盖
This commit is contained in:
parent
617d92f224
commit
2e9a0852cf
25
lib/pen.js
25
lib/pen.js
@ -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];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user