Merge pull request #181 from CartoDB/sprite-limit

Limits sprite radius to a maximum of 255
This commit is contained in:
Francisco Dans 2015-05-04 14:52:07 +02:00
commit 4b10cc37d0
2 changed files with 5 additions and 1 deletions

3
NEWS
View File

@ -1,3 +1,6 @@
2.11.3
- Limited sprite radius to a maximum of 255px
- Fixed custom marker-file functionality in Firefox
2.11.2
- Added error handling to Torque
- Fixed 'remove' event triggering when removing a Torque layer.

View File

@ -78,7 +78,8 @@
if (st['marker-fill-opacity'] !== undefined || st['marker-opacity'] !== undefined) {
ctx.globalAlpha = st['marker-fill-opacity'] || st['marker-opacity'];
}
ctx.drawImage(img, 0, 0, img.width, img.height);
var maxSpriteRadius = 255;
ctx.drawImage(img, 0, 0, Math.min(img.width, maxSpriteRadius), Math.min(img.height, maxSpriteRadius));
}
}