Skip to content

Commit

Permalink
fix: clone the style of image to mask #1349
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoiver committed May 25, 2023
1 parent 04c379b commit 9a3ee31
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/g-plugin-annotation/src/selectable/SelectableImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ export class SelectableImage extends AbstractSelectable<Rect> {
cursor: 'move',
},
});
this.image = new Image({
style: {
width: 0,
height: 0,
src: target.style.src,
},
this.image = target.cloneNode();
// @ts-ignore
this.image.attr({
x: 0,
y: 0,
selectable: false,
});
// this.image.setLocalPosition(0, 0, 0);
console.log(this.image);

this.appendChild(this.mask);
this.mask.appendChild(this.image);
Expand Down

0 comments on commit 9a3ee31

Please sign in to comment.