Skip to content

Commit

Permalink
Fix viewportPosition attributes access (closes openlayers#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredj committed Jun 3, 2013
1 parent 461d2a1 commit 4f0e09c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ol/interaction/touchrotateinteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ ol.interaction.TouchRotate.prototype.handleTouchMove =
// touch0,touch1 and previousTouch0,previousTouch1
var viewportPosition = goog.style.getClientPosition(map.getViewport());
var centroid = ol.interaction.Touch.centroid(this.targetTouches);
centroid[0] -= viewportPosition[0];
centroid[1] -= viewportPosition[1];
centroid[0] -= viewportPosition.x;
centroid[1] -= viewportPosition.y;
this.anchor_ = map.getCoordinateFromPixel(centroid);

// rotate
Expand Down
4 changes: 2 additions & 2 deletions src/ol/interaction/touchzoominteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ ol.interaction.TouchZoom.prototype.handleTouchMove =
// scale anchor point.
var viewportPosition = goog.style.getClientPosition(map.getViewport());
var centroid = ol.interaction.Touch.centroid(this.targetTouches);
centroid[0] -= viewportPosition[0];
centroid[1] -= viewportPosition[1];
centroid[0] -= viewportPosition.x;
centroid[1] -= viewportPosition.y;
this.anchor_ = map.getCoordinateFromPixel(centroid);

// scale, bypass the resolution constraint
Expand Down

0 comments on commit 4f0e09c

Please sign in to comment.