fix: 解决新增文字选中框错位问题
This commit is contained in:
parent
27cf1635f7
commit
6dc9e69fa1
16
lib/pen.js
16
lib/pen.js
@ -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];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user