Skip to content

Commit

Permalink
reverted changes of ecentSpec. Also added named type for Mock Pointer…
Browse files Browse the repository at this point in the history
…Event() return.
  • Loading branch information
Roman committed May 8, 2018
1 parent f4fd44a commit 6cc4de1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/engine/Input/Pointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ export class PointerMoveEvent extends PointerEvent {
* double-check is preformed, because user could move pointer too fast and
* in that case, pointer can appear out of boundings of the dragging element
*/
if (this.pointer.isDragging && this.pointer.dragTarget) {
actor = this.pointer.dragTarget;
if (this.pointer.isDragging) {
actor = this.pointer.dragTarget || actor;
} else if (!this.pointer.isActorUnderPointer(actor)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export class Scene extends Class implements ICanInitialize, ICanActivate, ICanDe
this._cancelQueue.length = 0;

// Cycle through timers updating timers
for (const timer of this._timers) {
for (var timer of this._timers) {
timer.update(delta);
};

Expand Down
6 changes: 3 additions & 3 deletions src/spec/EventSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('An Event Dispatcher', () => {
pubsub.on('someevent', () => {
eventFired = true;
});

newPubSub.emit('someevent', null);
expect(eventFired).toBeTruthy();
});
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('An Event Dispatcher', () => {

it('can listen to a handler only once', () => {
let pubsub = new ex.EventDispatcher(null);

let callCount = 0;
pubsub.once('onlyonce', () => {
callCount++;
Expand All @@ -107,4 +107,4 @@ describe('An Event Dispatcher', () => {

});

});
});
2 changes: 1 addition & 1 deletion src/spec/Mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ module Mocks {
return mockWindow;
};

pointerEvent(eventName) {
pointerEvent(eventName): ex.Input.PointerEvent {
const coordinates = new ex.GlobalCoordinates(new ex.Vector(0, 0), new ex.Vector(0, 0), new ex.Vector(0, 0));
const pointer = new ex.Input.Pointer();
const pointerType = ex.Input.PointerType.Mouse;
Expand Down

0 comments on commit 6cc4de1

Please sign in to comment.