diff --git a/lib/pen.js b/lib/pen.js index 69a9a21..6a663b7 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -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];