Properly handle modulo of negative numbers
This commit is contained in:
@@ -256,7 +256,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
|||||||
Math.log(this.minWidth_ * pointResolution) / Math.log(10));
|
Math.log(this.minWidth_ * pointResolution) / Math.log(10));
|
||||||
var count, width;
|
var count, width;
|
||||||
while (true) {
|
while (true) {
|
||||||
count = ol.control.ScaleLine.LEADING_DIGITS[i % 3] *
|
count = ol.control.ScaleLine.LEADING_DIGITS[((i % 3) + 3) % 3] *
|
||||||
Math.pow(10, Math.floor(i / 3));
|
Math.pow(10, Math.floor(i / 3));
|
||||||
width = Math.round(count / pointResolution);
|
width = Math.round(count / pointResolution);
|
||||||
if (isNaN(width)) {
|
if (isNaN(width)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user