-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
242 additions
and
624 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
packages/core/src/Canvas/usecase/CanvasPointerLeaveEventUseCase.ts
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,34 @@ | ||
import type { DisplayObject } from "@next2d/display"; | ||
import { $getRollOverDisplayObject } from "../../CoreUtil"; | ||
import { | ||
PointerEvent as Next2D_PointerEvent, | ||
$setEvent | ||
} from "@next2d/events"; | ||
|
||
/** | ||
* @description マウス、タップがDisplayObjectから離れた時に発生します。 | ||
* Occurs when the mouse or tap leaves the DisplayObject. | ||
* | ||
* @param {PointerEvent} event | ||
* @return {void} | ||
* @method | ||
* @protected | ||
*/ | ||
export const execute = (event: PointerEvent): void => | ||
{ | ||
$setEvent(event); | ||
|
||
const rollOverDisplayObject = $getRollOverDisplayObject() as DisplayObject; | ||
if (!rollOverDisplayObject) { | ||
return ; | ||
} | ||
|
||
if (rollOverDisplayObject.willTrigger(Next2D_PointerEvent.POINTER_LEAVE)) { | ||
// イベントの伝播を止める | ||
event.preventDefault(); | ||
|
||
rollOverDisplayObject.dispatchEvent( | ||
new Next2D_PointerEvent(Next2D_PointerEvent.POINTER_LEAVE) | ||
); | ||
} | ||
}; |
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
27 changes: 27 additions & 0 deletions
27
packages/core/src/Canvas/usecase/CanvasWheelEventUseCase.ts
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,27 @@ | ||
import { $stage } from "@next2d/display"; | ||
import { | ||
$setEvent, | ||
WheelEvent as Next2D_WheelEvent | ||
} from "@next2d/events"; | ||
|
||
/** | ||
* @description ホイールイベントを実行します。 | ||
* Executes the wheel event. | ||
* | ||
* @param {WheelEvent} event | ||
* @return {void} | ||
* @method | ||
* @protected | ||
*/ | ||
export const execute = (event: WheelEvent): void => | ||
{ | ||
$setEvent(event); | ||
if ($stage.willTrigger(Next2D_WheelEvent.WHEEL)) { | ||
// イベントの伝播を止める | ||
event.preventDefault(); | ||
|
||
$stage.dispatchEvent(new Next2D_WheelEvent( | ||
Next2D_WheelEvent.WHEEL | ||
)); | ||
} | ||
}; |
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.