Merge pull request #6064 from ahocevar/better-modify-box
Make vertex candidate selection work better on rotated views
This commit is contained in:
@@ -700,11 +700,9 @@ ol.interaction.Modify.prototype.handlePointerAtPixel_ = function(pixel, map) {
|
|||||||
ol.coordinate.squaredDistanceToSegment(pixelCoordinate, b.segment);
|
ol.coordinate.squaredDistanceToSegment(pixelCoordinate, b.segment);
|
||||||
};
|
};
|
||||||
|
|
||||||
var lowerLeft = map.getCoordinateFromPixel(
|
var box = ol.extent.buffer(
|
||||||
[pixel[0] - this.pixelTolerance_, pixel[1] + this.pixelTolerance_]);
|
ol.extent.createOrUpdateFromCoordinate(pixelCoordinate),
|
||||||
var upperRight = map.getCoordinateFromPixel(
|
map.getView().getResolution() * this.pixelTolerance_);
|
||||||
[pixel[0] + this.pixelTolerance_, pixel[1] - this.pixelTolerance_]);
|
|
||||||
var box = ol.extent.boundingExtent([lowerLeft, upperRight]);
|
|
||||||
|
|
||||||
var rBush = this.rBush_;
|
var rBush = this.rBush_;
|
||||||
var nodes = rBush.getInExtent(box);
|
var nodes = rBush.getInExtent(box);
|
||||||
|
|||||||
Reference in New Issue
Block a user