Explorar o código

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
640e9c7ce7
Modificáronse 2 ficheiros con 11 adicións e 4 borrados
  1. 1 0
      dist/preview release/what's new.md
  2. 10 4
      nodeEditor/src/diagram/graphFrame.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -352,6 +352,7 @@
 - Fix bug in PBR sheen when used with clear coat and no env texture provided ([Popov72](https://github.com/Popov72))
 - Fix for bug where Preview Area pop up does not change background color across windows ([#7377](https://github.com/BabylonJS/Babylon.js/issues/7684))([Kyle Belfort](https://github.com/belfortk))
 - Fix for bug where comments would break out of frames and break resizing of frames ([Kyle Belfort](https://github.com/belfortk))
+- Fix for bug where frames without comments would display undefined at the bottom right corner ([Kyle Belfort](https://github.com/belfortk))
 
 ## Breaking changes
 

+ 10 - 4
nodeEditor/src/diagram/graphFrame.ts

@@ -261,15 +261,21 @@ export class GraphFrame {
     }
 
     public set comments(comments: string) {
-        if (comments && (!this._comments || this._comments.length == 0) && comments.length > 0) {
+        if (comments && !this._comments && comments.length > 0) {
             this.element.style.gridTemplateRows = "40px min-content 1fr";
             this._borderElement.style.gridRow = "1 / span 3";
             this._portContainer.style.gridRow = "3";
             this._commentsElement.classList.add("has-comments");
-        } else if (comments && comments.length === 0) {
-            this._commentsElement.classList.remove('has-comments')
+        } else if (!comments) {
+            this.element.style.gridTemplateRows = "40px calc(100% - 40px)";
+            this._borderElement.style.gridRow = "1 / span 2";
+            this._portContainer.style.gridRow = "2";
+            this._commentsElement.classList.remove('has-comments');
+        }
+
+        if (comments === "" || (comments && comments.length >= 0)) {
+            this._commentsElement.innerText = comments;
         }
-        this._commentsElement.innerText = comments;
         this.height = this._borderElement.offsetHeight;
         this._comments = comments;
         this.updateMinHeightWithComments();