Browse Source

Expand/collapse (missing icons) NME

David Catuhe 5 năm trước cách đây
mục cha
commit
c93711a940

+ 5 - 2
nodeEditor/src/diagram/graphCanvas.tsx

@@ -206,11 +206,14 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
         }
     }
 
-    public getGridPosition(position: number) {
+    public getGridPosition(position: number, useCeil = false) {
         let gridSize = this.gridSize;
 		if (gridSize === 0) {
 			return position;
-		}
+        }
+        if (useCeil) {
+            return gridSize * Math.ceil(position / gridSize);    
+        }
 		return gridSize * Math.floor(position / gridSize);
     }
     

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 23 - 3
nodeEditor/src/diagram/graphFrame.ts


+ 3 - 3
nodeEditor/src/diagram/graphNode.ts

@@ -291,9 +291,9 @@ export class GraphNode {
         this._visual.setPointerCapture(evt.pointerId);
     }
 
-    public cleanAccumulation() {
-        this.x = this._ownerCanvas.getGridPosition(this.x);
-        this.y = this._ownerCanvas.getGridPosition(this.y);
+    public cleanAccumulation(useCeil = false) {
+        this.x = this._ownerCanvas.getGridPosition(this.x, useCeil);
+        this.y = this._ownerCanvas.getGridPosition(this.y, useCeil);
     }
 
     private _onUp(evt: PointerEvent) {

+ 2 - 0
src/Materials/material.ts

@@ -624,6 +624,7 @@ export class Material implements IAnimatable {
      * Locks updates for the material
      */
     public freeze(): void {
+        this._wasPreviouslyReady = false;
         this.checkReadyOnlyOnce = true;
     }
 
@@ -631,6 +632,7 @@ export class Material implements IAnimatable {
      * Unlocks updates for the material
      */
     public unfreeze(): void {
+        this._wasPreviouslyReady = false;
         this.checkReadyOnlyOnce = false;
     }