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);
|
||||
};
|
||||
|
||||
var lowerLeft = map.getCoordinateFromPixel(
|
||||
[pixel[0] - this.pixelTolerance_, pixel[1] + this.pixelTolerance_]);
|
||||
var upperRight = map.getCoordinateFromPixel(
|
||||
[pixel[0] + this.pixelTolerance_, pixel[1] - this.pixelTolerance_]);
|
||||
var box = ol.extent.boundingExtent([lowerLeft, upperRight]);
|
||||
var box = ol.extent.buffer(
|
||||
ol.extent.createOrUpdateFromCoordinate(pixelCoordinate),
|
||||
map.getView().getResolution() * this.pixelTolerance_);
|
||||
|
||||
var rBush = this.rBush_;
|
||||
var nodes = rBush.getInExtent(box);
|
||||
|
||||
Reference in New Issue
Block a user