make topic titles have width of 25 chars (#933)

This commit is contained in:
Devin Howard 2016-11-29 11:00:14 -05:00 committed by GitHub
parent 4da3a9d55f
commit 3f161c1076
2 changed files with 4 additions and 4 deletions

View file

@ -228,7 +228,7 @@ const JIT = {
ctx.fillStyle = '#FFF'
ctx.textBaseline = 'alphabetic'
const arrayOfLabelLines = Util.splitLine(desc, 30).split('\n')
const arrayOfLabelLines = Util.splitLine(desc, 25).split('\n')
let lineWidths = []
for (let index = 0; index < arrayOfLabelLines.length; ++index) {
lineWidths.push(ctx.measureText(arrayOfLabelLines[index]).width)
@ -497,7 +497,7 @@ const JIT = {
'contains': function(node, pos) {
const npos = node.pos.getc(true)
const dim = node.getData('dim')
const arrayOfLabelLines = Util.splitLine(node.name, 30).split('\n')
const arrayOfLabelLines = Util.splitLine(node.name, 25).split('\n')
const ctx = Visualize.mGraph.canvas.getCtx()
const height = 25 * arrayOfLabelLines.length
@ -1930,7 +1930,7 @@ const JIT = {
minY = y
}
let arrayOfLabelLines = Util.splitLine(n.name, 30).split('\n')
let arrayOfLabelLines = Util.splitLine(n.name, 25).split('\n')
let dim = n.getData('dim')
let ctx = canvas.getCtx()

View file

@ -7580,7 +7580,7 @@ Graph.Label.Native = new Class({
//START METAMAPS CODE
var arrayOfLabelLines = Metamaps.Util.splitLine(node.name,30).split('\n');
var arrayOfLabelLines = Metamaps.Util.splitLine(node.name, 25).split('\n');
//render background
ctx.fillStyle = ctx.strokeStyle = Metamaps.Settings.colors.labels.background;
ctx.lineWidth = 2;