[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0-4' - loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu May 9 13:27:03 UTC 2019


 loleaflet/src/layer/vector/SVGGroup.js |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit d6ce513574abbb5f566d97eb32ad340b6ed774e4
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Apr 4 10:51:37 2019 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu May 9 13:48:22 2019 +0200

    loleaflet: fix "select text with mouse after clicking into text box moves ...
    
    text box instead"
    
    Change-Id: Id867af5ebf7c93cc494be7fad93aae235ffa36d1
    Reviewed-on: https://gerrit.libreoffice.org/70262
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/70670
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/layer/vector/SVGGroup.js b/loleaflet/src/layer/vector/SVGGroup.js
index c719a7b1a..da8a40079 100644
--- a/loleaflet/src/layer/vector/SVGGroup.js
+++ b/loleaflet/src/layer/vector/SVGGroup.js
@@ -27,14 +27,21 @@ L.SVGGroup = L.Layer.extend({
 		if (doc.lastChild.localName !== 'svg')
 			return;
 
-		L.DomUtil.remove(this._rect._path);
-		this._svg = this._path.appendChild(doc.lastChild);
+		if (svgString.indexOf('XTEXT_PAINTSHAPE_BEGIN') !== -1) {
+			this._svg = this._path.insertBefore(doc.lastChild, this._rect._path);
+			this._rect._path.setAttribute('pointer-events', 'visibleStroke');
+			this._svg.setAttribute('pointer-events', 'none');
+		} else {
+			L.DomUtil.remove(this._rect._path);
+			this._svg = this._path.appendChild(doc.lastChild);
+			this._svg.setAttribute('pointer-events', 'visiblePainted');
+			L.DomEvent.on(this._svg, 'mousedown', this._onDragStart, this);
+			this._dragShape = this._svg;
+		}
+
 		this._svg.setAttribute('opacity', 0);
 		this._svg.setAttribute('width', size.x);
 		this._svg.setAttribute('height', size.y);
-		this._svg.setAttribute('pointer-events', 'visiblePainted');
-		this._dragShape = this._svg;
-		L.DomEvent.on(this._svg, 'mousedown', this._onDragStart, this);
 
 		this._update();
 	},


More information about the Libreoffice-commits mailing list