[Libreoffice-commits] online.git: loleaflet/src
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 12 17:11:44 UTC 2020
loleaflet/src/layer/marker/Annotation.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit b66bbc64ead28404cbabe3b41249961c67127a03
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Jul 11 21:14:38 2020 +0200
Commit: Tomaž Vajngerl <quikee at 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 <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee at 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);
}
},
More information about the Libreoffice-commits
mailing list