mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-27 10:22:35 +02:00
only getComputedTextLength() once
This commit is contained in:
+9
-5
@@ -1,10 +1,14 @@
|
||||
iD.svg.Lines = function() {
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
var arrowtext = '►\u3000\u3000',
|
||||
arrow = surface.append('text').text(arrowtext),
|
||||
alength = arrow.node().getComputedTextLength();
|
||||
|
||||
arrow.remove();
|
||||
var arrowtext = '►\u3000\u3000',
|
||||
alength;
|
||||
|
||||
return function(surface, graph, entities, filter, projection) {
|
||||
if (!alength) {
|
||||
var arrow = surface.append('text').text(arrowtext);
|
||||
alength = arrow.node().getComputedTextLength();
|
||||
arrow.remove();
|
||||
}
|
||||
|
||||
var lines = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user