@babylonjs/gui 8.3.1 → 8.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -556,10 +556,10 @@ export class AdvancedDynamicTexture extends DynamicTexture {
556
556
  // if the overlapGroup parameter is set, filter the controls and get only the controls belonging to that overlapGroup
557
557
  controlsForGroup = overlapGroup === undefined ? descendants.filter((c) => c.overlapGroup !== undefined) : descendants.filter((c) => c.overlapGroup === overlapGroup);
558
558
  }
559
- controlsForGroup.forEach((control1) => {
559
+ for (const control1 of controlsForGroup) {
560
560
  let velocity = Vector2.Zero();
561
561
  const center = new Vector2(control1.centerX, control1.centerY);
562
- controlsForGroup.forEach((control2) => {
562
+ for (const control2 of controlsForGroup) {
563
563
  if (control1 !== control2 && AdvancedDynamicTexture._Overlaps(control1, control2)) {
564
564
  // if the two controls overlaps get a direction vector from one control's center to another control's center
565
565
  const diff = center.subtract(new Vector2(control2.centerX, control2.centerY));
@@ -569,14 +569,14 @@ export class AdvancedDynamicTexture extends DynamicTexture {
569
569
  velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength));
570
570
  }
571
571
  }
572
- });
572
+ }
573
573
  if (velocity.length() > 0) {
574
574
  // move the control along the direction vector away from the overlapping control
575
575
  velocity = velocity.normalize().scale(deltaStep * (control1.overlapDeltaMultiplier ?? 1));
576
576
  control1.linkOffsetXInPixels += velocity.x;
577
577
  control1.linkOffsetYInPixels += velocity.y;
578
578
  }
579
- });
579
+ }
580
580
  }
581
581
  /**
582
582
  * Release all resources
@@ -906,7 +906,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
906
906
  if (camera.rigCameras.length) {
907
907
  // rig camera - we need to find the camera to use for this event
908
908
  const rigViewport = new Viewport(0, 0, 1, 1);
909
- camera.rigCameras.forEach((rigCamera) => {
909
+ for (const rigCamera of camera.rigCameras) {
910
910
  // generate the viewport of this camera
911
911
  rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport);
912
912
  const transformedX = x / engine.getHardwareScalingLevel() - rigViewport.x;
@@ -923,7 +923,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
923
923
  tempViewport.y = rigViewport.y;
924
924
  tempViewport.width = rigViewport.width;
925
925
  tempViewport.height = rigViewport.height;
926
- });
926
+ }
927
927
  }
928
928
  else {
929
929
  camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);