MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Resize

Method Resize

Source/Editor/Surface/SurfaceNode.cs:184–208  ·  view source on GitHub ↗

Resizes the node area. The width. The height.

(float width, float height)

Source from the content-addressed store, hash-verified

182 /// <param name="width">The width.</param>
183 /// <param name="height">The height.</param>
184 public virtual void Resize(float width, float height)
185 {
186 if (Surface == null)
187 return;
188
189 // Snap bounds (with ceil) when using grid snapping
190 if (Surface.GridSnappingEnabled)
191 {
192 var size = Surface.SnapToGrid(new Float2(width, height), true);
193 width = size.X;
194 height = size.Y;
195 }
196
197 // Arrange output boxes on the right edge
198 for (int i = 0; i < Elements.Count; i++)
199 {
200 if (Elements[i] is OutputBox box)
201 {
202 box.Location = box.Archetype.Position + new Float2(width - Constants.NodeMarginX, 0);
203 }
204 }
205
206 // Resize
207 Size = CalculateNodeSize(width, height);
208 }
209
210 /// <summary>
211 /// Automatically resizes the node to match the title size and all the elements for best fit of the node dimensions.

Callers 8

LoadProjectMethod · 0.45
LoadGraphMethod · 0.45
GetVisualScriptLocalsMethod · 0.45
SearchRegistryFunction · 0.45
GenerateTerrainMethod · 0.45
ExportTerrainMethod · 0.45

Calls 1

SnapToGridMethod · 0.45

Tested by

no test coverage detected