Remove use of goog.style.getClientPosition

Use Element.getBoundingClientRect() instead.
This commit is contained in:
Frederic Junod
2016-02-24 10:30:57 +01:00
parent 68088341d6
commit edf2096b1b
6 changed files with 20 additions and 28 deletions

View File

@@ -64,13 +64,13 @@ describe('ol.interaction.Modify', function() {
function simulateEvent(type, x, y, opt_shiftKey, button) {
var viewport = map.getViewport();
// calculated in case body has top < 0 (test runner with small window)
var position = goog.style.getClientPosition(viewport);
var position = viewport.getBoundingClientRect();
var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
var pointerEvent = new ol.pointer.PointerEvent(type, {
type: type,
button: button,
clientX: position.x + x + width / 2,
clientY: position.y + y + height / 2,
clientX: position.left + x + width / 2,
clientY: position.top + y + height / 2,
shiftKey: shiftKey
});
var event = new ol.MapBrowserPointerEvent(type, map, pointerEvent);
@@ -377,7 +377,6 @@ describe('ol.interaction.Modify', function() {
goog.require('goog.dispose');
goog.require('ol.events');
goog.require('goog.style');
goog.require('ol.Collection');
goog.require('ol.Feature');
goog.require('ol.Map');