ソースを参照

Add check for loading visualization image

anfeny 8 ヶ月 前
コミット
bab5e1ccf9
2 ファイル変更3 行追加2 行削除
  1. 3 2
      dashboard/src/static/js/sim/index.js
  2. 0 0
      simulator/utils/trace_compare.py

+ 3 - 2
dashboard/src/static/js/sim/index.js

@@ -32,8 +32,9 @@ function setup() {
     const canvas = createCanvas(baseWidth, baseHeight);
     canvas.parent(canvasContainer);
 
-    factoryImg.resize(1920 / (2 * scaleFactor), 1432 / (2*scaleFactor)); // half the original size
-
+    if (factoryImg) {
+        factoryImg.resize(1920 / (2 * scaleFactor), 1432 / (2 * scaleFactor)); // half the original size
+    }
     factory = new Factory(baseHeight, baseWidth, scaleFactor); // contains all components
 }
 

+ 0 - 0
simulator/utils/trace_compare.py