Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
yanmao committed Nov 4, 2021
1 parent 7f08459 commit 81d9454
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugins/image/src/component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 81d9454

Please sign in to comment.