Proper rounding for possibly negative numbers
This commit is contained in:
@@ -274,8 +274,8 @@ ol.render.canvas.Immediate.prototype.drawImages_ =
|
||||
var x = pixelCoordinates[i] - this.imageAnchorX_;
|
||||
var y = pixelCoordinates[i + 1] - this.imageAnchorY_;
|
||||
if (this.imageSnapToPixel_) {
|
||||
x = (x + 0.5) | 0;
|
||||
y = (y + 0.5) | 0;
|
||||
x = Math.round(x);
|
||||
y = Math.round(y);
|
||||
}
|
||||
if (rotation !== 0 || this.imageScale_ != 1) {
|
||||
var centerX = x + this.imageAnchorX_;
|
||||
|
||||
@@ -329,8 +329,8 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
||||
x = pixelCoordinates[d] - anchorX;
|
||||
y = pixelCoordinates[d + 1] - anchorY;
|
||||
if (snapToPixel) {
|
||||
x = (x + 0.5) | 0;
|
||||
y = (y + 0.5) | 0;
|
||||
x = Math.round(x);
|
||||
y = Math.round(y);
|
||||
}
|
||||
if (scale != 1 || rotation !== 0) {
|
||||
var centerX = x + anchorX;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user