From d4d49e7ce6489649d2d8230d7b3c75e07d0d6347 Mon Sep 17 00:00:00 2001 From: Mihails Akimenko Date: Mon, 12 Apr 2021 20:29:05 +0300 Subject: [PATCH] - Upgrade three.js 1.127.0 - Remove peer dependencies - Fix depth write after three.js upgrade --- package-lock.json | 14 +++++++------- package.json | 2 +- projects/atft/package.json | 5 +---- .../layout/dagre-composition.component.ts | 4 ++-- .../data-center/layout/dagre-edge.component.ts | 4 ++-- .../server/server-stand-actor.component.ts | 2 +- .../server/workstation-actor.component.ts | 2 +- .../object/connector/line-connector.component.ts | 2 +- .../src/lib/object/loader/svg-loader.component.ts | 3 ++- .../src/lib/object/text/text-mesh.component.ts | 2 +- 10 files changed, 19 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23dc237f..00ab94e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "dagre": "^0.8.5", "rxjs": "^6.6.7", "snyk": "^1.518.0", - "three": "^0.126.1", + "three": "^0.127.0", "uuid": "^8.3.2", "yaml": "^1.10.2", "zone.js": "~0.11.4" @@ -28135,9 +28135,9 @@ } }, "node_modules/three": { - "version": "0.126.1", - "resolved": "https://registry.npmjs.org/three/-/three-0.126.1.tgz", - "integrity": "sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ==" + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.127.0.tgz", + "integrity": "sha512-wtgrn+mhYUbobxT7QN3GPdu3SRpSBQvwY6uOzLChWS7QE//f7paDU/+wlzbg+ngeIvBBqjBHSRuywTh8A99Jng==" }, "node_modules/throttle-debounce": { "version": "2.3.0", @@ -55577,9 +55577,9 @@ } }, "three": { - "version": "0.126.1", - "resolved": "https://registry.npmjs.org/three/-/three-0.126.1.tgz", - "integrity": "sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ==" + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.127.0.tgz", + "integrity": "sha512-wtgrn+mhYUbobxT7QN3GPdu3SRpSBQvwY6uOzLChWS7QE//f7paDU/+wlzbg+ngeIvBBqjBHSRuywTh8A99Jng==" }, "throttle-debounce": { "version": "2.3.0", diff --git a/package.json b/package.json index 2f85d5c5..b5f5219d 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "dagre": "^0.8.5", "rxjs": "^6.6.7", "snyk": "^1.518.0", - "three": "^0.126.1", + "three": "^0.127.0", "uuid": "^8.3.2", "yaml": "^1.10.2", "zone.js": "~0.11.4" diff --git a/projects/atft/package.json b/projects/atft/package.json index dfeb6e67..2e2911b1 100644 --- a/projects/atft/package.json +++ b/projects/atft/package.json @@ -1,6 +1,6 @@ { "name": "atft", - "version": "1.4.16", + "version": "1.4.19", "description": "Ready-to-use Angular components for Three.js, see https://makimenko.github.io/angular-template-for-threejs/.", "keywords": [ "threejs", @@ -33,9 +33,6 @@ } ], "peerDependencies": { - "@angular/common": "^11.2.7", - "@angular/core": "^11.2.7", - "three": "^0.126.1" }, "dependencies": { "tslib": "^2.0.0" diff --git a/projects/atft/src/lib/actor/data-center/layout/dagre-composition.component.ts b/projects/atft/src/lib/actor/data-center/layout/dagre-composition.component.ts index 13c75760..291f3691 100644 --- a/projects/atft/src/lib/actor/data-center/layout/dagre-composition.component.ts +++ b/projects/atft/src/lib/actor/data-center/layout/dagre-composition.component.ts @@ -11,7 +11,7 @@ import {Subscription} from 'rxjs'; providers: [provideParent(DagreCompositionComponent)], template: ` diff --git a/projects/atft/src/lib/actor/data-center/layout/dagre-edge.component.ts b/projects/atft/src/lib/actor/data-center/layout/dagre-edge.component.ts index 1d042945..68777546 100644 --- a/projects/atft/src/lib/actor/data-center/layout/dagre-edge.component.ts +++ b/projects/atft/src/lib/actor/data-center/layout/dagre-edge.component.ts @@ -109,7 +109,7 @@ export class DagreEdgeComponent extends LineConnectorComponent implements OnInit color: appliedColor(this.materialColor), opacity: this.opacity, transparent: this.opacity < 1, - depthWrite: false + depthWrite: true }); // 2. Create start @@ -221,7 +221,7 @@ export class DagreEdgeComponent extends LineConnectorComponent implements OnInit edge.points.forEach(p => { if (!Number.isNaN(p.x) && !Number.isNaN(p.y)) { // console.log('x=' + p.x + ', y=' + p.y); - this.positions.push(p.x, p.y, 0); + this.positions.push(p.x, p.y, 0.1); } }); this.updateEnds(this.positions); diff --git a/projects/atft/src/lib/actor/data-center/server/server-stand-actor.component.ts b/projects/atft/src/lib/actor/data-center/server/server-stand-actor.component.ts index 817c812f..7d351131 100644 --- a/projects/atft/src/lib/actor/data-center/server/server-stand-actor.component.ts +++ b/projects/atft/src/lib/actor/data-center/server/server-stand-actor.component.ts @@ -21,7 +21,7 @@ import { AbstractServerActor } from './abstract-server-actor'; + [depthWrite]="true"> diff --git a/projects/atft/src/lib/actor/data-center/server/workstation-actor.component.ts b/projects/atft/src/lib/actor/data-center/server/workstation-actor.component.ts index ec59ac52..77b24061 100644 --- a/projects/atft/src/lib/actor/data-center/server/workstation-actor.component.ts +++ b/projects/atft/src/lib/actor/data-center/server/workstation-actor.component.ts @@ -18,7 +18,7 @@ import {AbstractServerActor} from './abstract-server-actor'; + [depthWrite]="true" > diff --git a/projects/atft/src/lib/object/connector/line-connector.component.ts b/projects/atft/src/lib/object/connector/line-connector.component.ts index 677a5be3..83ea2611 100644 --- a/projects/atft/src/lib/object/connector/line-connector.component.ts +++ b/projects/atft/src/lib/object/connector/line-connector.component.ts @@ -63,7 +63,7 @@ export class LineConnectorComponent extends AbstractConnector implements gapSize: this.gapSize, opacity: this.opacity, transparent: this.opacity < 1, - depthWrite: false + depthWrite: true }); this.matLine.resolution.set(window.innerWidth, window.innerHeight); if (!this.solid) { diff --git a/projects/atft/src/lib/object/loader/svg-loader.component.ts b/projects/atft/src/lib/object/loader/svg-loader.component.ts index 76fbaeaa..3e15154b 100644 --- a/projects/atft/src/lib/object/loader/svg-loader.component.ts +++ b/projects/atft/src/lib/object/loader/svg-loader.component.ts @@ -48,7 +48,7 @@ export class SVGLoaderComponent extends AbstractModelLoader { material = 'basic'; @Input() - depthWrite = false; + depthWrite = true; @Input() maxX: number; @@ -92,6 +92,7 @@ export class SVGLoaderComponent extends AbstractModelLoader { } } + if (this.maxX || this.maxY) { scaleToFit(group, new THREE.Vector3(this.maxX, this.maxY, 0)); } diff --git a/projects/atft/src/lib/object/text/text-mesh.component.ts b/projects/atft/src/lib/object/text/text-mesh.component.ts index 65affc3b..160f13f5 100644 --- a/projects/atft/src/lib/object/text/text-mesh.component.ts +++ b/projects/atft/src/lib/object/text/text-mesh.component.ts @@ -80,7 +80,7 @@ export class TextMeshComponent extends AbstractLazyObject3D { receiveShadow = true; @Input() - depthWrite = false; + depthWrite = true; @Input() centered = true;