diff --git a/src/lib/svg_text_utils.js b/src/lib/svg_text_utils.js index 3100c222170..37d8de07458 100644 --- a/src/lib/svg_text_utils.js +++ b/src/lib/svg_text_utils.js @@ -114,10 +114,11 @@ exports.convertToTspans = function(_context, gd, _callback) { .style({overflow: 'visible', 'pointer-events': 'none'}); var fill = _context.node().style.fill || 'black'; - newSvg.select('g').attr({fill: fill, stroke: fill}); + var g = newSvg.select('g'); + g.attr({fill: fill, stroke: fill}); - var newSvgW = getSize(newSvg, 'width'); - var newSvgH = getSize(newSvg, 'height'); + var newSvgW = getSize(g, 'width'); + var newSvgH = getSize(g, 'height'); var newX = +_context.attr('x') - newSvgW * {start: 0, middle: 0.5, end: 1}[_context.attr('text-anchor') || 'start']; // font baseline is about 1/4 fontSize below centerline diff --git a/tasks/test_bundle.js b/tasks/test_bundle.js index e561e05b3dd..ffa394cc408 100644 --- a/tasks/test_bundle.js +++ b/tasks/test_bundle.js @@ -31,6 +31,23 @@ glob(pathToJasmineBundleTests + '/*.js', function(err, files) { }; }); + var mathjaxTestFirefox = function(cb) { + var cmd = [ + 'karma', 'start', + path.join(constants.pathToRoot, 'test', 'jasmine', 'karma.conf.js'), + '--FF', + '--bundleTest=mathjax', + '--nowatch' + ].join(' '); + + console.log('Running: ' + cmd); + + exec(cmd, function(err) { + cb(null, err); + }).stdout.pipe(process.stdout); + }; + tasks.push(mathjaxTestFirefox); + runSeries(tasks, function(err, results) { if(err) throw err;