diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-07-11 21:14:38 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-07-12 19:11:25 +0200 |
commit | b66bbc64ead28404cbabe3b41249961c67127a03 (patch) | |
tree | ef9b01a886039d4af3d8cd4e356562e6c9129236 | |
parent | add .uno:EditAnnotation as exception when in read-only mode (diff) | |
download | online-b66bbc64ead28404cbabe3b41249961c67127a03.tar.gz online-b66bbc64ead28404cbabe3b41249961c67127a03.zip |
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>
-rw-r--r-- | loleaflet/src/layer/marker/Annotation.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 35d7565bc8..1418a86066 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -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); } }, |