From 4714763ea316935821660c830ed7c4073c85ef71 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Wed, 23 Jan 2013 16:18:57 -0500 Subject: [PATCH] Add a margin for point labels --- js/id/svg/labels.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/id/svg/labels.js b/js/id/svg/labels.js index a4e4eb93e..ddf1289f1 100644 --- a/js/id/svg/labels.js +++ b/js/id/svg/labels.js @@ -240,6 +240,7 @@ iD.svg.Labels = function(projection) { function getPointLabel(entity, width, height) { var coord = projection(entity.loc), + m = 5, // margin offset = pointOffsets[0], p = { height: height, @@ -248,7 +249,7 @@ iD.svg.Labels = function(projection) { y: coord[1] + offset[1], textAnchor: offset[2] } - var rect = new RTree.Rectangle(p.x, p.y, width, height); + var rect = new RTree.Rectangle(p.x - m, p.y - m, width + 2*m, height + 2*m); if (tryInsert(rect)) return p; }