|
1 | 1 | import { Logger } from "../Misc/logger";
|
2 |
| -import type { Observer } from "../Misc/observable"; |
| 2 | +import type { EventState, Observer } from "../Misc/observable"; |
3 | 3 | import { Observable } from "../Misc/observable";
|
4 | 4 | import type { Nullable } from "../types";
|
5 | 5 | import { Vector3 } from "../Maths/math.vector";
|
@@ -210,9 +210,15 @@ export class PositionGizmo extends Gizmo implements IPositionGizmo {
|
210 | 210 | // Relay drag events
|
211 | 211 | const gizmos = [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo];
|
212 | 212 | for (const gizmo of gizmos) {
|
213 |
| - gizmo.dragBehavior.onDragStartObservable.add(this.onDragStartObservable.notifyObservers.bind(this.onDragStartObservable)); |
214 |
| - gizmo.dragBehavior.onDragObservable.add(this.onDragObservable.notifyObservers.bind(this.onDragObservable)); |
215 |
| - gizmo.dragBehavior.onDragEndObservable.add(this.onDragEndObservable.notifyObservers.bind(this.onDragEndObservable)); |
| 213 | + gizmo.dragBehavior.onDragStartObservable.add((eventData: DragStartEndEvent, eventState: EventState) => |
| 214 | + this.onDragStartObservable.notifyObservers(eventData, eventState.mask, eventState.target, eventState.currentTarget, eventState.userInfo) |
| 215 | + ); |
| 216 | + gizmo.dragBehavior.onDragObservable.add((eventData: DragEvent, eventState: EventState) => |
| 217 | + this.onDragObservable.notifyObservers(eventData, eventState.mask, eventState.target, eventState.currentTarget, eventState.userInfo) |
| 218 | + ); |
| 219 | + gizmo.dragBehavior.onDragEndObservable.add((eventData: DragStartEndEvent, eventState: EventState) => |
| 220 | + this.onDragEndObservable.notifyObservers(eventData, eventState.mask, eventState.target, eventState.currentTarget, eventState.userInfo) |
| 221 | + ); |
216 | 222 | }
|
217 | 223 |
|
218 | 224 | this.attachedMesh = null;
|
|
0 commit comments