summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-09-08 16:03:15 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-09-08 16:04:06 +0100
commit53f3ef5bfb21d5a2ff0c61dd6500ca4c850a821a (patch)
tree2e93a9565c83c18e8afb7362b83a4ef2893b15d6
parentFix formulabar on mobile (diff)
downloadonline-53f3ef5bfb21d5a2ff0c61dd6500ca4c850a821a.tar.gz
online-53f3ef5bfb21d5a2ff0c61dd6500ca4c850a821a.zip
calc canvas: round view co-ordinates to the real pixels we need.
Change-Id: I768cd9015da1f1301f3ddad242130d4eddb426d1
-rw-r--r--loleaflet/src/geometry/Bounds.js7
-rw-r--r--loleaflet/src/layer/tile/CanvasTileLayer.js4
2 files changed, 11 insertions, 0 deletions
diff --git a/loleaflet/src/geometry/Bounds.js b/loleaflet/src/geometry/Bounds.js
index 8dacdc8327..e9ac075e8a 100644
--- a/loleaflet/src/geometry/Bounds.js
+++ b/loleaflet/src/geometry/Bounds.js
@@ -83,6 +83,13 @@ L.Bounds.prototype = {
(this.min.y + this.max.y) / 2, round);
},
+ round: function() {
+ this.min.x = Math.round(this.min.x);
+ this.min.y = Math.round(this.min.y);
+ this.max.x = Math.round(this.max.x);
+ this.max.y = Math.round(this.max.y);
+ },
+
getBottomLeft: function () { // -> Point
return new L.Point(this.min.x, this.max.y);
},
diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 5a030050a4..9f6f4c42b3 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -165,6 +165,10 @@ L.CanvasTilePainter = L.Class.extend({
var paneBounds = this._layer._cssBoundsToCore(ctx.paneBoundsList[i]);
var viewBounds = this._layer._cssBoundsToCore(ctx.viewBounds);
+ // into real pixel-land ...
+ paneBounds.round();
+ viewBounds.round();
+
if (!paneBounds.intersects(tileBounds))
continue;