diff options
author | Gökay Şatır <gokaysatir@collabora.com> | 2020-10-16 14:27:01 +0300 |
---|---|---|
committer | Gökay Şatır <gokaysatir@collabora.com> | 2020-10-16 14:27:01 +0300 |
commit | d6d39c7e6a0668725719e5d9014fe78cdcb7b41b (patch) | |
tree | 282c996dd6b11f2ee0e38d4ff4886a279138c8d0 | |
parent | Add missing linefeed to error message (diff) | |
download | online-private/gokay/aligncolumnheaders.tar.gz online-private/gokay/aligncolumnheaders.zip |
loleaflet: Align row and column headers for mobile devices.
private/gokay/aligncolumnheaders
-rw-r--r-- | loleaflet/src/control/Control.Header.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/loleaflet/src/control/Control.Header.js b/loleaflet/src/control/Control.Header.js index 89fc78fe07..89ccbba5f5 100644 --- a/loleaflet/src/control/Control.Header.js +++ b/loleaflet/src/control/Control.Header.js @@ -799,7 +799,7 @@ L.Control.Header.HeaderInfo = L.Class.extend({ update: function () { var bounds = this._map.getPixelBounds(); - var startPx = this._isCol ? bounds.getTopLeft().x : bounds.getTopLeft().y; + var startPx = this._isCol ? bounds.getTopLeft().x / (L.Browser.retina ? 2: 1) : bounds.getTopLeft().y / (L.Browser.retina ? 2: 1); this._docVisStart = startPx; var endPx = this._isCol ? bounds.getBottomRight().x : bounds.getBottomRight().y; var startIdx = this._dimGeom.getIndexFromPos(startPx, 'csspixels'); @@ -849,8 +849,8 @@ L.Control.Header.HeaderInfo = L.Class.extend({ var firstFreeSize = Math.max(0, firstFreeEnd - firstFreeStart); this._elements[startIdx] = { index: startIdx, - pos: firstFreeEnd, // end position on the header canvas - size: firstFreeSize, + pos: firstFreeEnd * (L.Browser.retina ? 2: 1), // end position on the header canvas + size: firstFreeSize * (L.Browser.retina ? 2: 1), origsize: dataFirstFree.size, }; @@ -861,8 +861,8 @@ L.Control.Header.HeaderInfo = L.Class.extend({ var size = endpos - startpos; this._elements[idx] = { index: idx, - pos: endpos, // end position on the header canvas - size: size, + pos: endpos * (L.Browser.retina ? 2: 1), // end position on the header canvas + size: size * (L.Browser.retina ? 2: 1), origsize: size, }; }.bind(this)); |