Browse Source

feat: 偏差

gemercheung 1 year ago
parent
commit
0accd5ba73
3 changed files with 7 additions and 5 deletions
  1. 4 3
      src/core/Scene.js
  2. 0 1
      src/core/box/HorizontalBox.js
  3. 3 1
      src/view/case/photos/index.vue

+ 4 - 3
src/core/Scene.js

@@ -166,7 +166,7 @@ export default class Scene extends Mitt {
     this.height =
       typeof rHeight === "height" ? rHeight : this.domElement.clientHeight;
 
-    const container = document.querySelector(".right");
+    const container = document.querySelector("#canvas");
     const { width, height } = container.getBoundingClientRect();
 
     if (width !== this.domElement.clientWidth) {
@@ -206,7 +206,7 @@ export default class Scene extends Mitt {
     this.orthCamera.zoom = this.defaultUseZoom;
     // this.orthCamera.position.set(0, 0, 0);
     // this.orthCamera.rotation.set(0, 10, 0);
-    // this.orthCamera.updateMatrixWorld();
+    this.orthCamera.updateMatrixWorld();
   }
 
   editing(item) {
@@ -247,8 +247,9 @@ export default class Scene extends Mitt {
       this.emit("devicePixelRatio");
       return;
     }
-    this.onResize();
+
     this.player.floorplanControls.reset();
+    this.onResize();
     this.lockView(true);
     this.setMode(0);
     // await sleep(500);

+ 0 - 1
src/core/box/HorizontalBox.js

@@ -29,7 +29,6 @@ export default class HorizontalBox extends THREE.Group {
   }
   load(data, index) {
     //box
-
     const geometry = new THREE.PlaneGeometry(1, 1);
     geometry.rotateX(-Math.PI / 2);
 

+ 3 - 1
src/view/case/photos/index.vue

@@ -457,8 +457,9 @@ onMounted(() => {
     width: calc(100% - 260px);
     background-color: var(--bgColor);
     padding-left: 24px;
-    height: calc(100% - 0px);
+    height: 100%;
     position: relative;
+    display: block;
 
     .tools {
       position: absolute;
@@ -522,6 +523,7 @@ onMounted(() => {
 <style scoped>
 :global(.body-layer) {
   padding-right: 0 !important;
+  overflow: hidden;
 }
 .save {
   background-color: #24569e;