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

fixed baseline

parent bb900664
...@@ -45,17 +45,17 @@ morpheus.HeatMapTrackColorLegend.prototype = { ...@@ -45,17 +45,17 @@ morpheus.HeatMapTrackColorLegend.prototype = {
var tracks = this.tracks; var tracks = this.tracks;
var colorModel = this.colorModel; var colorModel = this.colorModel;
var xpix = 0; var xpix = 0;
// legends are stacked horizontally // legends are placed side by side
for (var i = 0; i < tracks.length; i++) { for (var i = 0; i < tracks.length; i++) {
var ypix = 0; var ypix = 0;
var vector = tracks[i].getVector(); var vector = tracks[i].getVector();
context.fillStyle = morpheus.CanvasUtil.FONT_COLOR; context.fillStyle = morpheus.CanvasUtil.FONT_COLOR;
context.font = '12px ' + morpheus.CanvasUtil.FONT_NAME; context.font = '12px ' + morpheus.CanvasUtil.FONT_NAME;
context.textAlign = 'left'; context.textAlign = 'left';
// draw name // draw name
context.fillText(vector.getName(), xpix, ypix);
context.textBaseline = 'top'; context.textBaseline = 'top';
context.fillText(vector.getName(), xpix, ypix);
context.strokeStyle = 'LightGrey'; context.strokeStyle = 'LightGrey';
var maxWidth = 0; var maxWidth = 0;
var textWidth = context.measureText(vector.getName()).width; var textWidth = context.measureText(vector.getName()).width;
...@@ -63,6 +63,7 @@ morpheus.HeatMapTrackColorLegend.prototype = { ...@@ -63,6 +63,7 @@ morpheus.HeatMapTrackColorLegend.prototype = {
maxWidth = Math.max(0, textWidth); maxWidth = Math.max(0, textWidth);
} }
ypix += 14; ypix += 14;
var scheme = colorModel.getContinuousColorScheme(vector); var scheme = colorModel.getContinuousColorScheme(vector);
if (scheme != null) { // draw continuous color legend if (scheme != null) { // draw continuous color legend
context.save(); context.save();
...@@ -92,8 +93,8 @@ morpheus.HeatMapTrackColorLegend.prototype = { ...@@ -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); morpheus.Util.extend(morpheus.HeatMapTrackColorLegend, morpheus.AbstractCanvas);
\ No newline at end of file
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