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

2019-04-29 Thread Libreoffice Gerrit user
 loleaflet/plugins/path-transform/src/Path.Transform.js |   26 +++--
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit b51700b7b9498475932ebfda4159709e34752d61
Author: Marco Cecchetti 
AuthorDate: Mon Mar 4 20:36:45 2019 +0100
Commit: Henry Castro 
CommitDate: Tue Apr 30 04:14:50 2019 +0200

leaflet: after resizing a shape, dragging cursor with mouse pans view

The problem was in Path.Transform._apply executed at scale/rotate end
which enabled map dragging unconditionally.

Change-Id: Id42dc7de397a2ca2774f9d31a698c32b5e1c8514
Reviewed-on: https://gerrit.libreoffice.org/70559
Reviewed-by: Henry Castro 
Tested-by: Henry Castro 

diff --git a/loleaflet/plugins/path-transform/src/Path.Transform.js 
b/loleaflet/plugins/path-transform/src/Path.Transform.js
index f7efd72cc..3ea9ddaab 100644
--- a/loleaflet/plugins/path-transform/src/Path.Transform.js
+++ b/loleaflet/plugins/path-transform/src/Path.Transform.js
@@ -282,6 +282,7 @@ L.Handler.PathTransform = L.Handler.extend({
var matrix = this._matrix.clone();
var angle = this._angle;
var scale = this._scale.clone();
+   var moved = this._handleDragged;
 
this._transformGeometries();
 
@@ -299,7 +300,11 @@ L.Handler.PathTransform = L.Handler.extend({
 
this._updateHandlers();
 
-   map.dragging.enable();
+   if (this._mapDraggingWasEnabled) {
+   if (moved) L.DomEvent._fakeStop({ type: 'click' });
+   map.dragging.enable();
+   }
+
this._path.fire('transformed', {
matrix: matrix,
scale: scale,
@@ -576,7 +581,12 @@ L.Handler.PathTransform = L.Handler.extend({
_onRotateStart: function(evt) {
var map = this._map;
 
-   map.dragging.disable();
+   this._handleDragged = false;
+   this._mapDraggingWasEnabled = false;
+   if (map.dragging.enabled()) {
+   map.dragging.disable();
+   this._mapDraggingWasEnabled = true;
+   }
 
this._originMarker = null;
this._rotationOriginPt = 
map.latLngToLayerPoint(this._getRotationOrigin());
@@ -604,6 +614,8 @@ L.Handler.PathTransform = L.Handler.extend({
var previous = this._rotationStart;
var origin   = this._rotationOriginPt;
 
+   this._handleDragged = true;
+
// rotation step angle
this._angle = Math.atan2(pos.y - origin.y, pos.x - origin.x) -
Math.atan2(previous.y - origin.y, previous.x - 
origin.x);
@@ -649,7 +661,12 @@ L.Handler.PathTransform = L.Handler.extend({
var marker = evt.target;
var map = this._map;
 
-   map.dragging.disable();
+   this._handleDragged = false;
+   this._mapDraggingWasEnabled = false;
+   if (map.dragging.enabled()) {
+   map.dragging.disable();
+   this._mapDraggingWasEnabled = true;
+   }
 
this._activeMarker = marker;
 
@@ -688,6 +705,9 @@ L.Handler.PathTransform = L.Handler.extend({
_onScale: function(evt) {
var originPoint = this._originMarker._point;
var ratioX, ratioY;
+
+   this._handleDragged = true;
+
if (this.options.uniformScaling) {
ratioX = originPoint.distanceTo(evt.layerPoint) / 
this._initialDist;
ratioY = ratioX;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-21 Thread Libreoffice Gerrit user
 loleaflet/plugins/path-transform/src/Path.Transform.js |2 +-
 loleaflet/src/layer/vector/CircleMarker.js |4 
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 3cc714b49b6e29429d45818a281cd77a209dbec2
Author: Tor Lillqvist 
AuthorDate: Thu Mar 21 16:04:58 2019 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Mar 21 16:05:25 2019 +0200

Make the image resize and rotate handles larger in a mobile app

diff --git a/loleaflet/plugins/path-transform/src/Path.Transform.js 
b/loleaflet/plugins/path-transform/src/Path.Transform.js
index 50171d4ea..f7efd72cc 100644
--- a/loleaflet/plugins/path-transform/src/Path.Transform.js
+++ b/loleaflet/plugins/path-transform/src/Path.Transform.js
@@ -534,7 +534,7 @@ L.Handler.PathTransform = L.Handler.extend({
L.PathTransform.pointOnLine(
map.latLngToLayerPoint(bottom),
map.latLngToLayerPoint(topPoint),
-   this.options.handleLength)
+   (window.ThisIsAMobileApp ? this.options.handleLength * 
3 : this.options.handleLength))
);
 
this._handleLine = new L.Polyline([topPoint, handlerPosition],
diff --git a/loleaflet/src/layer/vector/CircleMarker.js 
b/loleaflet/src/layer/vector/CircleMarker.js
index 837471440..fd9a2e1fa 100644
--- a/loleaflet/src/layer/vector/CircleMarker.js
+++ b/loleaflet/src/layer/vector/CircleMarker.js
@@ -14,6 +14,8 @@ L.CircleMarker = L.Path.extend({
L.setOptions(this, options);
this._latlng = L.latLng(latlng);
this._radius = this.options.radius;
+   if (window.ThisIsAMobileApp)
+   this._radius *= 3;
},
 
setLatLng: function (latlng) {
@@ -28,6 +30,8 @@ L.CircleMarker = L.Path.extend({
 
setRadius: function (radius) {
this.options.radius = this._radius = radius;
+   if (window.ThisIsAMobileApp)
+   this._radius *= 3;
return this.redraw();
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-26 Thread Libreoffice Gerrit user
 loleaflet/plugins/path-transform/src/Path.Drag.js |9 +--
 loleaflet/src/layer/tile/TileLayer.js |5 
 loleaflet/src/layer/vector/SVGGroup.js|   26 +++---
 3 files changed, 35 insertions(+), 5 deletions(-)

New commits:
commit bbb6d34ac20efc3c05dc6dcd508962091f99fd52
Author: Marco Cecchetti 
AuthorDate: Sun Feb 24 17:59:16 2019 +0100
Commit: Szymon Kłos 
CommitDate: Tue Feb 26 09:19:57 2019 +0100

online: calc: selecting a chart element; impress: move caret by clicking

Clicking on individual chart elements doesn't select any object.
Better forwarding of single click when there is no drag action.
Start to display the svg preview for moved shapes images on first
mousemove event instead of mousedown. For text object, on editing,
this avoids to see the old text content when user clicks for changing
the cursor position.

This patch solve also the following impress issue: moving caret around
in text box by clicking around doesn't work

Change-Id: I316c7a92667bda8fa1e115bcc848b474cbc40242
Reviewed-on: https://gerrit.libreoffice.org/68314
Reviewed-by: Szymon Kłos 
Tested-by: Szymon Kłos 

diff --git a/loleaflet/plugins/path-transform/src/Path.Drag.js 
b/loleaflet/plugins/path-transform/src/Path.Drag.js
index 36acdd8b1..04ab67373 100644
--- a/loleaflet/plugins/path-transform/src/Path.Drag.js
+++ b/loleaflet/plugins/path-transform/src/Path.Drag.js
@@ -107,6 +107,7 @@ L.Handler.PathDrag = L.Handler.extend(/** @lends  
L.Path.Drag.prototype */ {
_onDragStart: function(evt) {
var eventType = evt.originalEvent._simulated ? 'touchstart' : 
evt.originalEvent.type;
 
+   this._mouseDown = evt.originalEvent;
this._mapDraggingWasEnabled = false;
this._startPoint = evt.containerPoint.clone();
this._dragStartPoint = evt.containerPoint.clone();
@@ -184,6 +185,7 @@ L.Handler.PathDrag = L.Handler.extend(/** @lends  
L.Path.Drag.prototype */ {
* @param  {L.MouseEvent} evt
*/
_onDragEnd: function(evt) {
+   L.DomEvent.stop(evt);
var containerPoint = 
this._path._map.mouseEventToContainerPoint(evt);
var moved = this.moved();
 
@@ -193,8 +195,6 @@ L.Handler.PathDrag = L.Handler.extend(/** @lends  
L.Path.Drag.prototype */ {
this._path._updatePath();
this._path._project();
this._path._transform(null);
-
-   L.DomEvent.stop(evt);
}
 
L.DomEvent.off(document, 'mousemove touchmove', this._onDrag,   
 this);
@@ -226,6 +226,11 @@ L.Handler.PathDrag = L.Handler.extend(/** @lends  
L.Path.Drag.prototype */ {
if (moved) L.DomEvent._fakeStop({ type: 'click' });
this._path._map.dragging.enable();
}
+
+   if (!moved) {
+   this._path._map._handleDOMEvent(this._mouseDown);
+   this._path._map._handleDOMEvent(evt)
+   }
},
 
 
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 70a5bf376..6ac7ad501 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1815,6 +1815,11 @@ L.TileLayer = L.GridLayer.extend({
}
else if (e.type === 'graphicmoveend') {
var deltaPos = 
aPos.subtract(this._graphicMarker._startPos);
+   if (deltaPos.x === 0 && deltaPos.y === 0) {
+   this._graphicMarker.isDragged = false;
+   return;
+   }
+
var newPos = 
this._graphicSelectionTwips.min.add(deltaPos);
var size = this._graphicSelectionTwips.getSize();
 
diff --git a/loleaflet/src/layer/vector/SVGGroup.js 
b/loleaflet/src/layer/vector/SVGGroup.js
index c9548e347..c719a7b1a 100644
--- a/loleaflet/src/layer/vector/SVGGroup.js
+++ b/loleaflet/src/layer/vector/SVGGroup.js
@@ -42,8 +42,9 @@ L.SVGGroup = L.Layer.extend({
_onDragStart: function(evt) {
if (!this._dragShape)
return;
+   this._moved = false;
 
-   this._showEmbeddedSVG();
+   L.DomEvent.on(this._dragShape, 'mousemove', this._onDrag, this);
L.DomEvent.on(this._dragShape, 'mouseup', this._onDragEnd, 
this);
 
var data = {
@@ -56,16 +57,35 @@ L.SVGGroup = L.Layer.extend({
this.fire('graphicmovestart', {pos: pos});
},
 
-   _onDragEnd: function(evt) {
+   _onDrag: function(evt) {
if (!this._dragShape)
return;
 
+   if (!this._moved) {
+   this._moved = true;
+   

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

2019-02-16 Thread Libreoffice Gerrit user
 0 files changed

New commits:
commit f51f71f9ad754caaadcee64baab8743c4d9bd76f
Author: Tor Lillqvist 
AuthorDate: Thu Jan 31 17:50:40 2019 +0200
Commit: Michael Meeks 
CommitDate: Sat Feb 16 22:27:20 2019 +0100

Avoid having files with names that differ only in case

Such file names make git operations a bit painful if you happen to have a
clone of this on a case-insensitive file system.

Signed-off-by: Michael Meeks 

diff --git a/loleaflet/plugins/path-transform/Readme.md 
b/loleaflet/plugins/path-transform/Readme2.md
similarity index 100%
rename from loleaflet/plugins/path-transform/Readme.md
rename to loleaflet/plugins/path-transform/Readme2.md
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits