Skip to content

Commit

Permalink
nullable element
Browse files Browse the repository at this point in the history
Former-commit-id: 943785b46b90eed0a2c4971c74e9e094b4c8142f
  • Loading branch information
RaananW committed Apr 13, 2021
1 parent 0e14ed5 commit c292040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sprites/spriteSceneComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class SpriteSceneComponent implements ISceneComponent {
return result;
}

private _pointerMove(unTranslatedPointerX: number, unTranslatedPointerY: number, pickResult: Nullable<PickingInfo>, isMeshPicked: boolean, element: HTMLElement): Nullable<PickingInfo> {
private _pointerMove(unTranslatedPointerX: number, unTranslatedPointerY: number, pickResult: Nullable<PickingInfo>, isMeshPicked: boolean, element: Nullable<HTMLElement>): Nullable<PickingInfo> {
var scene = this.scene;
if (isMeshPicked) {
scene.setPointerOverSprite(null);
Expand All @@ -323,7 +323,7 @@ export class SpriteSceneComponent implements ISceneComponent {

if (pickResult && pickResult.hit && pickResult.pickedSprite) {
scene.setPointerOverSprite(pickResult.pickedSprite);
if (!scene.doNotHandleCursors) {
if (!scene.doNotHandleCursors && element) {
if (scene._pointerOverSprite && scene._pointerOverSprite.actionManager && scene._pointerOverSprite.actionManager.hoverCursor) {
element.style.cursor = scene._pointerOverSprite.actionManager.hoverCursor;
} else {
Expand Down

0 comments on commit c292040

Please sign in to comment.