diff --git a/lib/pen.js b/lib/pen.js index 8535907..3a8b7f4 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -332,13 +332,19 @@ export default class Painter { } else if (align === 'right') { left = x - width } + var top = y; + if (verticalAlign === 'center') { + top = y - height / 2; + } else if (verticalAlign === 'bottom') { + top = y - height + } view.rect = { - left, - top: y, + left: left, + top: top, right: left + width, - bottom: y + height, - x: view.css && view.css.right ? (x - width) : x, - y + bottom: top + height, + x: view.css && view.css.right ? x - width : x, + y: y }; const pd = this._doPaddings(view); view.rect.left = view.rect.left - pd[3];