sunrize 2.0.16 → 2.1.0

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.
@@ -2,11 +2,49 @@
2
2
 
3
3
  const
4
4
  X3DBoundedObjectTool = require ("../Grouping/X3DBoundedObjectTool"),
5
- ToolColors = require ("../Core/ToolColors");
5
+ ToolColors = require ("../Core/ToolColors"),
6
+ X3D = require ("../../X3D");
6
7
 
7
8
  class LayoutGroupTool extends X3DBoundedObjectTool
8
9
  {
9
10
  toolBBoxColor = ToolColors .DARK_GREEN;
11
+
12
+ #scale = new X3D .Vector3 ();
13
+ #rectangleScale = new X3D .Vector4 ();
14
+ #rectangle = new X3D .Vector4 ();
15
+
16
+ traverse (type, renderObject)
17
+ {
18
+ if (this .tool)
19
+ {
20
+ if (this .layoutNode)
21
+ {
22
+ if (!this .tool .layoutDisplay)
23
+ this .tool .layoutDisplay = true;
24
+
25
+ renderObject .modelViewMatrix .get () .get (null, null, this .#scale);
26
+ this .#rectangleScale .set (this .#scale .x, this .#scale .y, this .#scale .x, this .#scale .y);
27
+
28
+ this .layoutNode .push (type, renderObject);
29
+
30
+ const rectangle = this .#rectangle
31
+ .assign (renderObject .getLayoutRectangles () .at (-1))
32
+ .divVec (this .#rectangleScale);
33
+
34
+ if (!this .tool .layoutRectangle .getValue () .equals (rectangle))
35
+ this .tool .layoutRectangle = rectangle;
36
+
37
+ this .layoutNode .pop (type, renderObject);
38
+ }
39
+ else
40
+ {
41
+ if (this .tool .layoutDisplay)
42
+ this .tool .layoutDisplay = false;
43
+ }
44
+ }
45
+
46
+ super .traverse (type, renderObject);
47
+ }
10
48
  }
11
49
 
12
50
  module .exports = LayoutGroupTool;
@@ -534,7 +534,8 @@ ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd () }
534
534
  </x3d-canvas>
535
535
  <p>Made with <a href="https://create3000.github.io/sunrize/" target="_blank">Sunrize X3D Editor</a>. If local files are not loaded <a href="https://create3000.github.io/x_ite/setup-a-localhost-server">consider setup a localhost server</a> or use <a href="https://create3000.github.io/x_ite/dom-integration">DOM integration methods</a>.</p>
536
536
  </body>
537
- </html>`
537
+ </html>
538
+ `
538
539
  }
539
540
 
540
541
  static absoluteURL = new RegExp ("^(?:[a-z]+:|//)", "i");