Fix sticker example. (#4172)

Stickers didn't stick since they were binding to themselves.

Fixes #3982

### Change type

- [x] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Test plan

1. Use the sticker example
2. The sticker should stick 😄 

### Release notes

- Fix the sticker example.
This commit is contained in:
Mitja Bezenšek 2024-07-15 16:56:56 +02:00 committed by GitHub
parent 01bc73e750
commit fe3dc0d965
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,6 +90,7 @@ class StickerShapeUtil extends ShapeUtil<StickerShape> {
const target = this.editor.getShapeAtPoint(pageAnchor, { const target = this.editor.getShapeAtPoint(pageAnchor, {
hitInside: true, hitInside: true,
filter: (shape) => filter: (shape) =>
shape.id !== sticker.id &&
this.editor.canBindShapes({ fromShape: sticker, toShape: shape, binding: 'sticker' }), this.editor.canBindShapes({ fromShape: sticker, toShape: shape, binding: 'sticker' }),
}) })