fix: 解决新增文字选中框错位问题

This commit is contained in:
0JARVIS0 2019-11-26 11:20:51 +08:00
parent 27cf1635f7
commit 6dc9e69fa1

View File

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