[Libreoffice-commits] online.git: loleaflet/src

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 20 07:43:46 UTC 2019


 loleaflet/src/layer/tile/WriterTileLayer.js |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9ec45224d3be5d3e4f6b49e9f39ff76f798cd9b0
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Jun 20 09:43:25 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jun 20 09:43:25 2019 +0200

    WriterTileLayer: allow inserting comments when having a graphic selection
    
    This requires core.git 351b9aefe3de7c68e907fdc7926d9b508560320e (sw:
    implement inserting comments when an as-char image is selected,
    2019-06-18).
    
    Change-Id: I16142d949e97305adf692730bf697c7cd23d3ee7

diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js
index 727711027..8b714b362 100644
--- a/loleaflet/src/layer/tile/WriterTileLayer.js
+++ b/loleaflet/src/layer/tile/WriterTileLayer.js
@@ -11,6 +11,12 @@ L.WriterTileLayer = L.TileLayer.extend({
 			comment.anchorPos = L.bounds(this._latLngToTwips(this._visibleCursor.getSouthWest()),
 				this._latLngToTwips(this._visibleCursor.getNorthEast()));
 			comment.anchorPix = this._twipsToPixels(comment.anchorPos.min);
+		} else if (this._graphicSelection && !this._isEmptyRectangle(this._graphicSelection)) {
+			// An image is selected, then guess the anchor based on the graphic
+			// selection.
+			comment.anchorPos = L.bounds(this._latLngToTwips(this._graphicSelection.getSouthWest()),
+				this._latLngToTwips(this._graphicSelection.getNorthEast()));
+			comment.anchorPix = this._twipsToPixels(comment.anchorPos.min);
 		}
 		if (comment.anchorPos) {
 			this._annotations.modify(this._annotations.add(comment));


More information about the Libreoffice-commits mailing list