From d4813b6b341ac857f22abe72f5edce592a54a6ad Mon Sep 17 00:00:00 2001 From: Nick Markov Date: Thu, 1 Aug 2024 15:15:12 -0500 Subject: [PATCH] Fix condition shape placement on the heatmap cells Finding the center of the rectangle of a heatmap cell --- src/ui/heat_map_element_canvas.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/heat_map_element_canvas.js b/src/ui/heat_map_element_canvas.js index fc80a4da..6b2e017b 100644 --- a/src/ui/heat_map_element_canvas.js +++ b/src/ui/heat_map_element_canvas.js @@ -429,16 +429,16 @@ morpheus.HeatMapElementCanvas.prototype = { cellRowSize -= 2; cellColumnSize -= 2; } - var x = px + xoffset + cellRowSize / 2; - var y = py + yoffset + cellColumnSize / 2; + var x = px + xoffset + cellColumnSize / 2; + var y = py + yoffset + cellRowSize / 2; morpheus.CanvasUtil.drawShape(context, condition.shape, x, y, Math.min(cellColumnSize, cellRowSize) / 2, true); } else { // e.g. filled circle on top of heat map drawFunction(px + xoffset, py + yoffset, cellColumnSize, cellRowSize); // x and y are at center - var x = px + xoffset + cellRowSize / 2; - var y = py + yoffset + cellColumnSize / 2; + var x = px + xoffset + cellColumnSize / 2; + var y = py + yoffset + cellRowSize / 2; context.fillStyle = condition.color; morpheus.CanvasUtil.drawShape(context, condition.shape, x, y, Math.min(cellColumnSize, cellRowSize) / 4, true);