[Libreoffice-commits] online.git: loleaflet/src
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 24 08:32:42 UTC 2019
loleaflet/src/layer/tile/TileLayer.TableOverlay.js | 1 +
loleaflet/src/layer/tile/TileLayer.js | 5 +++--
loleaflet/src/layer/vector/Path.Transform.js | 19 +++++++++++++------
3 files changed, 17 insertions(+), 8 deletions(-)
New commits:
commit 6413d9ffe92ddfb5803f48115a65d973a076ca00
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Sep 23 23:13:22 2019 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Sep 24 10:32:23 2019 +0200
allow only south east graphic markers for table selection
Change-Id: I581a6a6319c4f3008fb8f5ed14cc57b3df991f42
Reviewed-on: https://gerrit.libreoffice.org/79427
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.TableOverlay.js b/loleaflet/src/layer/tile/TileLayer.TableOverlay.js
index d02c89b59..7af0d971b 100644
--- a/loleaflet/src/layer/tile/TileLayer.TableOverlay.js
+++ b/loleaflet/src/layer/tile/TileLayer.TableOverlay.js
@@ -175,6 +175,7 @@ L.TileLayer.include({
textMsg = textMsg.substring('tableselected:'.length + 1);
var message = JSON.parse(textMsg);
this._currentTableData = message;
+ this._hasTableSelection = this._currentTableData.rows != null || this._currentTableData.columns != null;
this._updateTableMarkers();
this._map.on('zoomend', L.bind(this._onZoom, this));
},
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 6851333c5..f608dc11d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2392,8 +2392,9 @@ L.TileLayer = L.GridLayer.extend({
this._graphicMarker.dragging.enable();
this._graphicMarker.transform.enable({
scaling: extraInfo.isResizable,
- rotation: extraInfo.isRotatable,
- uniformScaling: !this._isGraphicAngleDivisibleBy90()});
+ rotation: extraInfo.isRotatable && !this._hasTableSelection,
+ uniformScaling: !this._isGraphicAngleDivisibleBy90(),
+ scaleSouthAndEastOnly: this._hasTableSelection});
if (extraInfo.dragInfo && extraInfo.dragInfo.svg) {
this._graphicMarker.removeEmbeddedSVG();
this._graphicMarker.addEmbeddedSVG(extraInfo.dragInfo.svg);
diff --git a/loleaflet/src/layer/vector/Path.Transform.js b/loleaflet/src/layer/vector/Path.Transform.js
index 47a32698e..2beb7a3dd 100644
--- a/loleaflet/src/layer/vector/Path.Transform.js
+++ b/loleaflet/src/layer/vector/Path.Transform.js
@@ -51,6 +51,7 @@ L.Handler.PathTransform = L.Handler.extend({
options: {
rotation: true,
scaling: true,
+ scaleSouthAndEastOnly: false,
uniformScaling: true,
maxZoom: 22,
@@ -831,13 +832,19 @@ L.Handler.PathTransform = L.Handler.extend({
*/
_createHandler: function(latlng, type, index) {
var HandleClass = this.options.handleClass;
+ var options = {
+ className: 'leaflet-drag-transform-marker drag-marker--' +
+ index + ' drag-marker--' + type,
+ index: index,
+ type: type,
+ };
+ if (this.options.scaleSouthAndEastOnly && index < 5) {
+ options.opacity = 0;
+ options.fill = false;
+ options.interactive = false;
+ }
var marker = new HandleClass(latlng,
- L.Util.extend({}, this.options.handlerOptions, {
- className: 'leaflet-drag-transform-marker drag-marker--' +
- index + ' drag-marker--' + type,
- index: index,
- type: type
- })
+ L.Util.extend({}, this.options.handlerOptions, options)
);
marker.on('mousedown', this._onScaleStart, this);
More information about the Libreoffice-commits
mailing list