mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Performance: only draw midpoints in select mode
This commit is contained in:
@@ -15,6 +15,13 @@ import {
|
||||
export function svgMidpoints(projection, context) {
|
||||
|
||||
return function drawMidpoints(selection, graph, entities, filter, extent) {
|
||||
var layer = selection.selectAll('.layer-hit');
|
||||
|
||||
if (context.mode().id !== 'select') {
|
||||
layer.selectAll('g.midpoint').remove();
|
||||
return;
|
||||
}
|
||||
|
||||
var poly = extent.polygon(),
|
||||
midpoints = {};
|
||||
|
||||
@@ -86,8 +93,6 @@ export function svgMidpoints(projection, context) {
|
||||
}
|
||||
|
||||
|
||||
var layer = selection.selectAll('.layer-hit');
|
||||
|
||||
var groups = layer
|
||||
.selectAll('g.midpoint')
|
||||
.filter(midpointFilter)
|
||||
|
||||
Reference in New Issue
Block a user