Restores labels in aggregations.

pull/639/head
Martin Czuchra 11 years ago
parent e197fc5c2e
commit 7202eb49f7
  1. 23
      app/assets/javascripts/timelines.js

@ -2954,6 +2954,29 @@ Timeline = {
e.translate(x, y);
});
} else {
textColor = timeline.getLimunanceFor(color) > Timeline.PE_LUMINANCE_THRESHOLD ?
Timeline.PE_DARK_TEXT_COLOR : Timeline.PE_LIGHT_TEXT_COLOR;
var text = this.subject;
label = timeline.paper.text(0, 0, text);
label.attr({
'font-size': 12,
'fill': textColor,
'stroke': 'none'
});
x = label_space.x + label_space.w/2;
y -= 4;
while (text.length > 0 && label.getBBox().width > label_space.w) {
text = text.slice(0, -1);
label.attr({ 'text': text });
}
label.translate(x, y);
}
}

Loading…
Cancel
Save