Commit 2797fbab authored by Joshua Gould's avatar Joshua Gould

fixed baseline

parent bb900664
......@@ -45,17 +45,17 @@ morpheus.HeatMapTrackColorLegend.prototype = {
var tracks = this.tracks;
var colorModel = this.colorModel;
var xpix = 0;
// legends are stacked horizontally
// legends are placed side by side
for (var i = 0; i < tracks.length; i++) {
var ypix = 0;
var vector = tracks[i].getVector();
context.fillStyle = morpheus.CanvasUtil.FONT_COLOR;
context.font = '12px ' + morpheus.CanvasUtil.FONT_NAME;
context.textAlign = 'left';
// draw name
context.fillText(vector.getName(), xpix, ypix);
context.textBaseline = 'top';
context.fillText(vector.getName(), xpix, ypix);
context.strokeStyle = 'LightGrey';
var maxWidth = 0;
var textWidth = context.measureText(vector.getName()).width;
......@@ -63,6 +63,7 @@ morpheus.HeatMapTrackColorLegend.prototype = {
maxWidth = Math.max(0, textWidth);
}
ypix += 14;
var scheme = colorModel.getContinuousColorScheme(vector);
if (scheme != null) { // draw continuous color legend
context.save();
......@@ -92,8 +93,8 @@ morpheus.HeatMapTrackColorLegend.prototype = {
}
});
}
xpix += maxWidth + 10 + 14; // space between columns + color chip
xpix += maxWidth + 10 + 14; // space between tracks + color chip
}
}
};
morpheus.Util.extend(morpheus.HeatMapTrackColorLegend, morpheus.AbstractCanvas);
\ No newline at end of file
morpheus.Util.extend(morpheus.HeatMapTrackColorLegend, morpheus.AbstractCanvas);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment