-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from dnass/layer-events
Add layer hit detection and event handling
- Loading branch information
Showing
14 changed files
with
533 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.9.0 | ||
|
||
- Add layer-level hit detection and event handling. | ||
|
||
## 0.8.1 | ||
|
||
- Remove SvelteKit `browser` check. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { createEventDispatcher } from 'svelte'; | ||
|
||
export type Events = | ||
| 'click' | ||
| 'contextmenu' | ||
| 'dblclick' | ||
| 'mousedown' | ||
| 'mouseenter' | ||
| 'mouseleave' | ||
| 'mousemove' | ||
| 'mouseup' | ||
| 'wheel' | ||
| 'touchcancel' | ||
| 'touchend' | ||
| 'touchmove' | ||
| 'touchstart' | ||
| 'pointerenter' | ||
| 'pointerleave' | ||
| 'pointerdown' | ||
| 'pointermove' | ||
| 'pointerup' | ||
| 'pointercancel'; | ||
|
||
export type LayerEventDetail = { | ||
x: number; | ||
y: number; | ||
originalEvent: MouseEvent | TouchEvent; | ||
}; | ||
|
||
export type LayerEvents = { | ||
[E in Events]: LayerEventDetail; | ||
}; | ||
|
||
export type CanvasLayerEvent = CustomEvent<LayerEventDetail>; | ||
|
||
export type LayerEventDispatcher = ReturnType< | ||
typeof createEventDispatcher<LayerEvents> | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.