mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Name drawing functions so we can profile them
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
iD.svg.Areas = function() {
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
return function drawAreas(surface, graph, entities, filter, projection) {
|
||||
var areas = [];
|
||||
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
|
||||
@@ -53,7 +53,7 @@ iD.svg.Lines = function() {
|
||||
return paths;
|
||||
}
|
||||
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
return function drawLines(surface, graph, entities, filter, projection) {
|
||||
|
||||
if (!alength) {
|
||||
var arrow = surface.append('text').text(arrowtext);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
iD.svg.Midpoints = function() {
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
return function drawMidpoints(surface, graph, entities, filter, projection) {
|
||||
var midpoints = [];
|
||||
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
|
||||
@@ -10,7 +10,7 @@ iD.svg.Points = function() {
|
||||
return 'icons/unknown.png';
|
||||
}
|
||||
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
return function drawPoints(surface, graph, entities, filter, projection) {
|
||||
var points = [];
|
||||
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
@@ -20,6 +20,10 @@ iD.svg.Points = function() {
|
||||
}
|
||||
}
|
||||
|
||||
if (points.length > 100) {
|
||||
return surface.select('.layer-hit').selectAll('g.point').remove();
|
||||
}
|
||||
|
||||
var groups = surface.select('.layer-hit').selectAll('g.point')
|
||||
.filter(filter)
|
||||
.data(points, iD.Entity.key);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
iD.svg.Surface = function() {
|
||||
return function(selection) {
|
||||
return function drawSurface(selection) {
|
||||
selection.append('defs')
|
||||
.append('clipPath')
|
||||
.attr('id', 'clip')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
iD.svg.Vertices = function() {
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
return function drawVertices(surface, graph, entities, filter, projection) {
|
||||
var vertices = [];
|
||||
|
||||
for (var i = 0; i < entities.length; i++) {
|
||||
@@ -9,6 +9,10 @@ iD.svg.Vertices = function() {
|
||||
}
|
||||
}
|
||||
|
||||
if (vertices.length > 2000) {
|
||||
return surface.select('.layer-hit').selectAll('g.vertex').remove();
|
||||
}
|
||||
|
||||
var groups = surface.select('.layer-hit').selectAll('g.vertex')
|
||||
.filter(filter)
|
||||
.data(vertices, iD.Entity.key);
|
||||
|
||||
Reference in New Issue
Block a user