xushiting 2 rokov pred
rodič
commit
92fdaba72d
2 zmenil súbory, kde vykonal 6 pridanie a 4 odobranie
  1. 5 1
      src/graphic/Coordinate.js
  2. 1 3
      src/graphic/Load.js

+ 5 - 1
src/graphic/Coordinate.js

@@ -22,7 +22,11 @@ export default class Coordinate {
   }
 
   setRes(res) {
-    this.res = res;
+    if (res) {
+      this.res = res;
+    } else {
+      this.res = defaultRes;
+    }
   }
 
   getRes() {

+ 1 - 3
src/graphic/Load.js

@@ -393,9 +393,7 @@ export default class Load {
             bgImg.setBounding();
           }
         } catch (e) {}
-        if (data3d.meterPerPixel) {
-          coordinate.setRes(data3d.meterPerPixel);
-        }
+        coordinate.setRes(data3d.meterPerPixel);
         const width = bgImg.imageData.width;
         const height = bgImg.imageData.height;
         let angle = 0;