Update index.ts

This commit is contained in:
yanmao 2021-11-04 10:52:09 +08:00
parent 7f08459702
commit 81d9454585
1 changed files with 8 additions and 6 deletions

View File

@ -256,12 +256,14 @@ class ImageComponent extends Card<ImageValue> {
if (this.type === CardType.BLOCK && this.image) {
const maxWidth = this.image.getMaxWidth();
const offset = (maxWidth - this.image.root.width()) / 2;
this.toolbarModel?.setOffset([
-offset - 12,
0,
-offset - 12,
0,
]);
if (value.status === 'done') {
this.toolbarModel?.setOffset([
-offset - 12,
0,
-offset - 12,
0,
]);
}
if (this.activated)
this.toolbarModel?.showCardToolbar();
}