[Libreoffice-commits] online.git: 3 commits - loleaflet/src
Andrzej Hunt
andrzej.hunt at collabora.com
Thu Nov 12 03:25:22 PST 2015
loleaflet/src/control/Control.ColumnHeader.js | 8 ++++++--
loleaflet/src/control/Control.RowHeader.js | 8 ++++++--
loleaflet/src/layer/tile/TileLayer.js | 2 +-
3 files changed, 13 insertions(+), 5 deletions(-)
New commits:
commit e97afd38771abc302115e81de87983d31a865fcf
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Thu Nov 12 12:24:20 2015 +0100
loleaflet: row size is also sum of widths
diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js
index 02625ae..de28ec2 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -39,27 +39,31 @@ L.Control.RowHeader = L.Control.extend({
var iterator, twip, height, row, cell;
this.clearRows();
+ var totalHeight = -1;
for (iterator = 0; iterator < rows.length; iterator++) {
twip = new L.Point(parseInt(rows[iterator].size),
parseInt(rows[iterator].size));
- height = Math.round(converter.call(context, twip).y) - 2;
+ height = Math.round(converter.call(context, twip).y) - 2 - totalHeight;
row = L.DomUtil.create('tr', '', this._rows);
cell = L.DomUtil.create('th', 'spreadsheet-table-row-cell', row);
cell.innerHTML = rows[iterator].text;
cell.twipHeight = rows[iterator].size;
cell.height = height + "px";
+ totalHeight += height + 1;
}
},
updateRows: function (converter, context) {
var iterator, twip, height, row;
+ var totalHeight = -1;
for (iterator = 0; iterator < this._rows.childNodes.length; iterator++) {
row = this._rows.childNodes[iterator].firstChild;
twip = new L.Point(parseInt(row.twipHeight),
parseInt(row.twipHeight));
- height = Math.round(converter.call(context, twip).y) - 1;
+ height = Math.round(converter.call(context, twip).y) - 2 - totalHeight;
row.height = height + "px";
+ totalHeight += height + 1;
}
}
})
commit a7d74ed5ee6f90ca7e47e72cc946f3c279cde050
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Thu Nov 12 12:23:33 2015 +0100
loleaflet: don't delete non-existing marker
Previously there were spurious warnings when trying to delete
a non-existing marker.
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index eddb2bb..88f7752 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -798,7 +798,7 @@ L.TileLayer = L.GridLayer.extend({
}
this._map.addLayer(this._cellCursorMarker);
}
- else if (this._cellCursor) {
+ else if (this._cellCursorMarker) {
this._map.removeLayer(this._cellCursorMarker);
}
},
commit eaf5a65e8b8441eb7a8a6e2ce3fb45a3c4839066
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Thu Nov 12 11:31:49 2015 +0100
loleaflet: column size is actually sum of widths
diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js
index 7c3934c..b2f9af4 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -45,25 +45,29 @@ L.Control.ColumnHeader = L.Control.extend({
var twip, width, column;
this.clearColumns();
+ var totalWidth = -1; // beginning offset 1 due to lack of previous column
for (iterator = 0; iterator < columns.length; iterator++) {
twip = new L.Point(parseInt(columns[iterator].size),
parseInt(columns[iterator].size));
- width = Math.round(converter.call(context, twip).x) - 1;
+ width = Math.round(converter.call(context, twip).x) - 2 - totalWidth;
column = L.DomUtil.create('th', 'spreadsheet-table-column-cell', this._columns);
column.innerHTML = columns[iterator].text;
column.twipWidth = columns[iterator].size;
column.width = width + "px";
+ totalWidth += width + 1;
}
},
updateColumns: function (converter, context) {
var iterator, twip, width, column;
+ var totalWidth = -1;
for (iterator = 0; iterator < this._columns.childNodes.length; iterator++) {
column = this._columns.childNodes[iterator];
twip = new L.Point(parseInt(column.twipWidth),
parseInt(column.twipWidth));
- width = Math.round(converter.call(context, twip).x) - 1;
+ width = Math.round(converter.call(context, twip).x) - 2 - totalWidth;
column.width = width + "px";
+ totalWidth += width + 1;
}
}
})
More information about the Libreoffice-commits
mailing list