Skip to content

Commit

Permalink
Merge branch 'master' of github.com:vmichnowicz/KineticJS into vmichn…
Browse files Browse the repository at this point in the history
…owicz-master

Conflicts:
	src/Layer.js
  • Loading branch information
lavrton committed Aug 24, 2014
2 parents 7fb330d + 494f40b commit ba5420d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
}

Kinetic.Container.prototype.drawHit.call(this, canvas, top);
this.imageData = null; // Clear imageData cache
return this;
},
/**
Expand Down
19 changes: 18 additions & 1 deletion src/Stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
TAP = 'tap',
DBL_TAP = 'dbltap',
TOUCHMOVE = 'touchmove',
DOMMOUSESCROLL = 'DOMMouseScroll',
MOUSEWHEEL = 'mousewheel',
WHEEL = 'wheel',

CONTENT_MOUSEOUT = 'contentMouseout',
CONTENT_MOUSEOVER = 'contentMouseover',
Expand All @@ -40,7 +43,7 @@
UNDERSCORE = '_',
CONTAINER = 'container',
EMPTY_STRING = '',
EVENTS = [MOUSEDOWN, MOUSEMOVE, MOUSEUP, MOUSEOUT, TOUCHSTART, TOUCHMOVE, TOUCHEND, MOUSEOVER],
EVENTS = [MOUSEDOWN, MOUSEMOVE, MOUSEUP, MOUSEOUT, TOUCHSTART, TOUCHMOVE, TOUCHEND, MOUSEOVER, DOMMOUSESCROLL, MOUSEWHEEL, WHEEL],

// cached variables
eventsLength = EVENTS.length;
Expand Down Expand Up @@ -609,6 +612,20 @@
}
}
},
_DOMMouseScroll: function(evt) {
this._mousewheel(evt);
},
_mousewheel: function(evt) {
this._setPointerPosition(evt);
var shape = this.getIntersection(this.getPointerPosition());

if (shape && shape.isListening()) {
shape._fireAndBubble(MOUSEWHEEL, {evt: evt});
}
},
_wheel: function(evt) {
this._mousewheel(evt);
},
_setPointerPosition: function(evt) {
var contentPosition = this._getContentPosition(),
offsetX = evt.offsetX,
Expand Down

0 comments on commit ba5420d

Please sign in to comment.