mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
fix tree bug where removes would fail
the width or height of the rtree rectangle created by extentRectangle would be negative. These rectangles insert ok, and are found by search, but they cannot be removed. issue #1370
This commit is contained in:
@@ -10,9 +10,9 @@ iD.Tree = function(graph) {
|
||||
function extentRectangle(extent) {
|
||||
x = m * extent[0][0],
|
||||
y = m * extent[0][1],
|
||||
dx = m * extent[1][0] - x || 2,
|
||||
dy = m * extent[1][1] - y || 2;
|
||||
return new RTree.Rectangle(~~x, ~~y, ~~dx - 1, ~~dy - 1);
|
||||
dx = Math.max(m * extent[1][0] - x, 1),
|
||||
dy = Math.max(m * extent[1][1] - y, 1);
|
||||
return new RTree.Rectangle(~~x, ~~y, ~~dx, ~~dy);
|
||||
}
|
||||
|
||||
function insert(entity) {
|
||||
|
||||
Reference in New Issue
Block a user