fix annotation position latlng to twips conversion

Change-Id: Ia97036a60a135a538dcd733e1f6715025f534b3c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98590
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl 2020-07-11 21:14:38 +02:00 committed by Tomaž Vajngerl
parent 08d81615e7
commit b66bbc64ea

View file

@ -473,7 +473,7 @@ L.Annotation = L.Layer.extend({
var bounds = new L.LatLngBounds(
this._map._docLayer._twipsToLatLng(topLeftTwips, this._map.getZoom()),
this._map._docLayer._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
this._annotationMarker.setLatLng(bounds.getSouthWest());
this._annotationMarker.setLatLng(bounds.getNorthWest());
this._annotationMarker.on('dragstart drag dragend', this._onMarkerDrag, this);
}
},
@ -481,8 +481,7 @@ L.Annotation = L.Layer.extend({
if (this._annotationMarker == null)
return;
if (event.type === 'dragend') {
var rect = this._annotationMarker._icon.getBoundingClientRect();
var pointTwip = this._map._docLayer._pixelsToTwips({x: rect.left, y: rect.top});
var pointTwip = this._map._docLayer._latLngToTwips(this._annotationMarker.getLatLng());
this._sendAnnotationPositionChange(pointTwip);
}
},