Change ol.Kinetic.update arguments.

Instead of goog.events.BrowserEvent, accept a x,y pair.
This commit is contained in:
Frederic Junod
2013-02-06 12:55:15 +01:00
parent 0c205da290
commit 2fea469037
2 changed files with 13 additions and 9 deletions

View File

@@ -63,23 +63,25 @@ ol.Kinetic = function(decay, minVelocity, delay) {
/**
* @param {goog.events.BrowserEvent} browserEvent Browser event.
* @param {number} x X.
* @param {number} y Y.
*/
ol.Kinetic.prototype.begin = function(browserEvent) {
ol.Kinetic.prototype.begin = function(x, y) {
this.points_.length = 0;
this.angle_ = 0;
this.initialVelocity_ = 0;
this.update(browserEvent);
this.update(x, y);
};
/**
* @param {goog.events.BrowserEvent} browserEvent Browser event.
* @param {number} x X.
* @param {number} y Y.
*/
ol.Kinetic.prototype.update = function(browserEvent) {
ol.Kinetic.prototype.update = function(x, y) {
this.points_.push({
x: browserEvent.clientX,
y: browserEvent.clientY,
x: x,
y: y,
t: goog.now()
});
};