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

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 16 12:40:16 UTC 2020


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

New commits:
commit 9374a2883537d41d6994e5a77fd45bb5fbe9a0d7
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Mon Mar 16 10:58:06 2020 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Mon Mar 16 13:39:55 2020 +0100

    Jump view to cursor on switching tab
    
    Change-Id: I76baf85858b46ba23ad6b6dd01d8716027cc43f2
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90548
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 2bb1a8215..52660885a 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1061,6 +1061,11 @@ L.TileLayer = L.GridLayer.extend({
 			horizontalDirection = sign(this._cellCursor.getWest() - this._prevCellCursor.getWest());
 			verticalDirection = sign(this._cellCursor.getNorth() - this._prevCellCursor.getNorth());
 		}
+		else if (!this._isEmptyRectangle(this._cellCursor)) {
+			// This is needed for jumping view to cursor position on tab switch
+			horizontalDirection = sign(this._cellCursor.getWest() - L.Point(0, 0));
+			verticalDirection = sign(this._cellCursor.getNorth() - L.Point(0, 0));
+		}
 
 		var onPgUpDn = false;
 		if (!this._isEmptyRectangle(this._cellCursor) && !this._prevCellCursor.equals(this._cellCursor)) {


More information about the Libreoffice-commits mailing list