From 2fe9cc4aac8ebc82437ee7c7db9840c889dd7529 Mon Sep 17 00:00:00 2001 From: Emanuele Bezzi Date: Wed, 8 Dec 2021 17:20:06 -0500 Subject: [PATCH] Small fix --- client/src/components/graph/graph.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/graph/graph.js b/client/src/components/graph/graph.js index 4e2d5e8f..75199f0f 100644 --- a/client/src/components/graph/graph.js +++ b/client/src/components/graph/graph.js @@ -803,10 +803,11 @@ class Graph extends React.Component { }); updateReglAndRender(asyncProps, prevAsyncProps) { - const { positions, colors, flags, height, width } = asyncProps; + const { positions, colors, flags, height, width, imageUnderlay } = + asyncProps; this.cachedAsyncProps = asyncProps; const { pointBuffer, colorBuffer, flagBuffer } = this.state; - let needToRenderCanvas = true; + let needToRenderCanvas = false; console.log("updateReglAndRender"); @@ -825,6 +826,9 @@ class Graph extends React.Component { flagBuffer({ data: flags, dimension: 1 }); needToRenderCanvas = true; } + if (imageUnderlay !== prevAsyncProps?.imageUnderlay) { + needToRenderCanvas = true; + } if (needToRenderCanvas) this.renderCanvas(); }