loleaflet/src/layer/marker/Annotation.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
New commits: commit b66bbc64ead28404cbabe3b41249961c67127a03 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Jul 11 21:14:38 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Jul 12 19:11:25 2020 +0200 fix annotation position latlng to twips conversion Change-Id: Ia97036a60a135a538dcd733e1f6715025f534b3c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98590 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 35d7565bc..1418a8606 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); } }, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits