sunrize 2.4.0 → 2.5.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.
Files changed (50) hide show
  1. package/package.json +7 -7
  2. package/src/Application/Application.js +21 -2
  3. package/src/Application/Dashboard.js +21 -19
  4. package/src/Application/DataStorage.js +10 -37
  5. package/src/Application/Document.js +149 -22
  6. package/src/Application/Footer.js +62 -16
  7. package/src/Application/Hierarchy.js +1 -1
  8. package/src/Application/Interface.js +1 -1
  9. package/src/Application/Sidebar.js +12 -9
  10. package/src/Application/Tabs.js +79 -11
  11. package/src/Controls/Splitter.js +146 -19
  12. package/src/Controls/Tabs.js +17 -12
  13. package/src/Editors/AnimationEditor.js +203 -194
  14. package/src/Editors/AnimationMemberList.js +37 -6
  15. package/src/Editors/BrowserFrame.js +17 -10
  16. package/src/Editors/Console.js +9 -13
  17. package/src/Editors/MediaRecorder.js +27 -0
  18. package/src/Editors/NodeList.js +35 -0
  19. package/src/Editors/OutlineEditor.js +20 -20
  20. package/src/Editors/OutlineView.js +85 -61
  21. package/src/Editors/Panel.js +6 -3
  22. package/src/Editors/RouteGraph.js +72 -102
  23. package/src/Editors/SceneProperties.js +4 -4
  24. package/src/Editors/ScriptEditor.js +37 -23
  25. package/src/Tools/Core/X3DBaseTool.js +11 -10
  26. package/src/Tools/Core/X3DImportedNodeInstanceTool.js +52 -0
  27. package/src/Tools/Core/X3DPrototypeInstanceTool.js +6 -6
  28. package/src/Tools/Grids/GridTool.js +6 -2
  29. package/src/Tools/Grids/X3DGridNodeTool.js +1 -1
  30. package/src/Tools.js +0 -3
  31. package/src/Undo/Editor.js +19 -16
  32. package/src/Undo/UndoManager.js +1 -1
  33. package/src/assets/fonts/Roboto/OFL.txt +93 -0
  34. package/src/assets/fonts/Roboto/README.txt +118 -0
  35. package/src/assets/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
  36. package/src/assets/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
  37. package/src/assets/fonts/Roboto_Mono/OFL.txt +93 -0
  38. package/src/assets/fonts/Roboto_Mono/README.txt +77 -0
  39. package/src/assets/fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf +0 -0
  40. package/src/assets/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf +0 -0
  41. package/src/assets/html/application.html +34 -9
  42. package/src/assets/html/window.html +6 -7
  43. package/src/assets/themes/default.css +133 -156
  44. package/src/assets/themes/{system-colors.css → definitions.css} +50 -7
  45. package/src/assets/themes/media-template.css +3 -2
  46. package/src/assets/themes/media.css +3 -2
  47. package/src/assets/themes/prompt-template.css +4 -1
  48. package/src/assets/themes/prompt.css +4 -1
  49. package/src/assets/html/application-template.html +0 -164
  50. package/src/assets/html/window-template.html +0 -39
@@ -62,166 +62,167 @@ module .exports = class AnimationEditor extends Interface
62
62
 
63
63
  // Toolbar
64
64
 
65
- this .toolbar = $("<div></div>")
66
- .attr ("id", "animation-editor-toolbar")
67
- .addClass (["animation-editor-toolbar", "toolbar", "horizontal-toolbar"])
65
+ this .controls = $("<div></div>")
66
+ .attr ("id", "animation-editor-controls")
67
+ .addClass (["animation-editor-controls", "toolbar", "horizontal-toolbar"])
68
68
  .appendTo (this .animationEditor);
69
69
 
70
70
  this .createAnimationIcon = $("<span></span>")
71
71
  .addClass (["material-symbols-outlined", "disabled"])
72
+ .css ("scale", "0.8")
72
73
  .attr ("title", _("Create animation."))
73
74
  .text ("animation")
74
- .appendTo (this .toolbar)
75
+ .appendTo (this .controls)
75
76
  .on ("click", () => this .createAnimation ());
76
77
 
77
- $("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
78
+ $("<span></span>") .addClass ("separator") .appendTo (this .controls);
78
79
 
79
80
  this .addMembersIcon = $("<span></span>")
80
- .addClass ("material-icons")
81
+ .addClass ("material-symbols-outlined")
81
82
  .attr ("title", _("Add member(s) to animation."))
82
83
  .text ("add")
83
- .appendTo (this .toolbar)
84
+ .appendTo (this .controls)
84
85
  .on ("click", () => this .addMembers ());
85
86
 
86
- $("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
87
+ $("<span></span>") .addClass ("separator") .appendTo (this .controls);
87
88
 
88
89
  this .cutFrameIcon = $("<span></span>")
89
- .addClass ("material-icons")
90
+ .addClass ("material-symbols-outlined")
91
+ .css ("scale", "0.7")
90
92
  .attr ("title", darwin
91
93
  ? _("Cut selected keyframes. (⌘X)")
92
94
  : _("Cut selected keyframes. (Ctrl+X)"))
93
95
  .text ("content_cut")
94
- .appendTo (this .toolbar)
96
+ .appendTo (this .controls)
95
97
  .on ("click", () => this .cutKeyframes ());
96
98
 
97
99
  this .copyFrameIcon = $("<span></span>")
98
- .addClass ("material-icons")
100
+ .addClass ("material-symbols-outlined")
101
+ .css ("scale", "0.7")
99
102
  .attr ("title", darwin
100
103
  ? _("Copy selected keyframes. (⌘C)")
101
104
  : _("Copy selected keyframes. (Ctrl+C)"))
102
105
  .text ("content_copy")
103
- .appendTo (this .toolbar)
106
+ .appendTo (this .controls)
104
107
  .on ("click", () => this .copyKeyframes ());
105
108
 
106
109
  this .pasteFrameIcon = $("<span></span>")
107
- .addClass ("material-icons")
110
+ .addClass ("material-symbols-outlined")
111
+ .css ("scale", "0.7")
108
112
  .attr ("title", darwin
109
113
  ? _("Paste keyframes at current frame. (⌘V)")
110
114
  : _("Paste keyframes at current frame. (Ctrl+V)"))
111
115
  .text ("content_paste")
112
- .appendTo (this .toolbar)
116
+ .appendTo (this .controls)
113
117
  .on ("click", () => this .pasteKeyframes ());
114
118
 
115
- $("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
119
+ $("<span></span>") .addClass ("separator") .appendTo (this .controls);
116
120
 
117
121
  this .firstFrameIcon = $("<span></span>")
118
- .addClass ("material-icons")
122
+ .addClass ("material-symbols-outlined")
123
+ .css ("scale", "0.8")
119
124
  .attr ("title", _("Go to first frame."))
120
125
  .text ("first_page")
121
- .appendTo (this .toolbar)
126
+ .appendTo (this .controls)
122
127
  .on ("click", () => this .firstFrame ());
123
128
 
124
129
  this .toggleAnimationIcon = $("<span></span>")
125
- .addClass ("material-icons")
130
+ .addClass (["material-symbols-outlined", "fill"])
131
+ .css ("scale", "0.8")
126
132
  .attr ("title", _("Start animation. (Space)"))
127
133
  .text ("play_arrow")
128
- .appendTo (this .toolbar)
134
+ .appendTo (this .controls)
129
135
  .on ("click", () => this .toggleAnimation ());
130
136
 
131
137
  this .lastFrameIcon = $("<span></span>")
132
- .addClass ("material-icons")
138
+ .addClass ("material-symbols-outlined")
139
+ .css ("scale", "0.8")
133
140
  .attr ("title", _("Go to last frame."))
134
141
  .text ("last_page")
135
- .appendTo (this .toolbar)
142
+ .appendTo (this .controls)
136
143
  .on ("click", () => this .lastFrame ());
137
144
 
138
145
  this .loopIcon = $("<span></span>")
139
- .addClass ("material-icons")
146
+ .addClass ("material-symbols-outlined")
147
+ .css ("scale", "0.7")
140
148
  .attr ("title", _("Loop animation."))
141
- .text ("loop")
142
- .appendTo (this .toolbar)
149
+ .text ("repeat")
150
+ .appendTo (this .controls)
143
151
  .on ("click", () => this .toggleLoop ());
144
152
 
145
153
  this .frameInput = $("<input></input>")
146
154
  .addClass ("input")
155
+ .css ("width", "70px")
147
156
  .attr ("type", "number")
148
157
  .attr ("step", 1)
149
158
  .attr ("min", 0)
150
159
  .attr ("max", 0)
151
160
  .attr ("title", _("Current frame."))
152
- .css ("width", "70px")
153
- .appendTo (this .toolbar)
161
+ .appendTo (this .controls)
154
162
  .on ("change input", () => this .setCurrentFrame (this .getCurrentFrame ()));
155
163
 
156
164
  this .propertiesIcon = $("<span></span>")
157
- .addClass ("material-icons")
165
+ .addClass ("material-symbols-outlined")
166
+ .css ("scale", "0.7")
158
167
  .attr ("title", _("Edit animation properties."))
159
168
  .text ("access_time")
160
- .appendTo (this .toolbar)
169
+ .appendTo (this .controls)
161
170
  .on ("click", () => this .showProperties ());
162
171
 
163
- $("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
172
+ $("<span></span>") .addClass ("separator") .appendTo (this .controls);
164
173
 
165
174
  this .keyTypeElement = $("<select></select>")
166
175
  .addClass ("select")
176
+ .css ("margin-left", "5px")
167
177
  .attr ("title", _("Select keyframe type."))
168
178
  .append ($("<option></option>") .text ("CONSTANT"))
169
179
  .append ($("<option></option>") .text ("LINEAR") .attr ("selected", ""))
170
180
  .append ($("<option></option>") .text ("SPLINE"))
171
181
  .append ($("<option></option>") .text ("SPLIT"))
172
182
  .append ($("<option></option>") .text ("MIXED") .hide ())
173
- .appendTo (this .toolbar)
183
+ .appendTo (this .controls)
174
184
  .on ("change", () => this .setKeyType ());
175
185
 
176
186
  this .timeElement = $("<span></span>")
177
- .addClass (["text", "right"])
187
+ .addClass ("text")
188
+ .css ("margin-left", "auto")
178
189
  .attr ("title", _("Current frame time (hours:minutes:seconds:frames)."))
179
- .css ("top", "7.5px")
180
- .css ("margin-right", "6px")
181
190
  .text (this .formatFrames (0, 10))
182
- .appendTo (this .toolbar);
191
+ .appendTo (this .controls);
183
192
 
184
193
  // Navigation toolbar
185
194
 
186
- this .navigation = $("<div></div>")
187
- .attr ("id", "animation-editor-navigation")
188
- .addClass (["animation-editor-navigation", "toolbar", "vertical-toolbar", "secondary-toolbar"])
195
+ this .toolbar = $("<div></div>")
196
+ .attr ("id", "animation-editor-toolbar")
197
+ .addClass (["animation-editor-toolbar", "toolbar", "vertical-toolbar", "secondary-toolbar"])
189
198
  .appendTo (this .animationEditor);
190
199
 
191
200
  this .zoomOutIcon = $("<span></span>")
192
- .addClass ("material-icons")
201
+ .addClass ("material-symbols-outlined")
193
202
  .attr ("title", _("Zoom timeline out. (-)"))
194
- .css ("transform", "scale(1.5)")
195
- .css ("margin-bottom", "15px")
196
203
  .text ("zoom_out")
197
- .appendTo (this .navigation)
204
+ .appendTo (this .toolbar)
198
205
  .on ("click", () => this .zoomOut ());
199
206
 
200
207
  this .zoomInIcon = $("<span></span>")
201
- .addClass ("material-icons")
208
+ .addClass ("material-symbols-outlined")
202
209
  .attr ("title", _("Zoom timeline in. (+)"))
203
- .css ("transform", "scale(1.5)")
204
- .css ("margin-bottom", "15px")
205
210
  .text ("zoom_in")
206
- .appendTo (this .navigation)
211
+ .appendTo (this .toolbar)
207
212
  .on ("click", () => this .zoomIn ());
208
213
 
209
214
  this .zoomFitIcon = $("<span></span>")
210
- .addClass ("material-icons")
215
+ .addClass ("material-symbols-outlined")
211
216
  .attr ("title", _("Zoom timeline to fit in window. (0)"))
212
- .css ("transform", "scale(1.4)")
213
- .css ("margin-bottom", "15px")
214
217
  .text ("fit_screen")
215
- .appendTo (this .navigation)
218
+ .appendTo (this .toolbar)
216
219
  .on ("click", () => this .zoomFit ());
217
220
 
218
221
  this .zoom100Icon = $("<span></span>")
219
- .addClass ("material-icons")
222
+ .addClass ("material-symbols-outlined")
220
223
  .attr ("title", _("Default timeline zoom. (1)"))
221
- .css ("transform", "scale(1.4)")
222
- .css ("margin-bottom", "15px")
223
224
  .text ("1x_mobiledata")
224
- .appendTo (this .navigation)
225
+ .appendTo (this .toolbar)
225
226
  .on ("click", () => this .zoom100 ());
226
227
 
227
228
  // Animations List
@@ -416,7 +417,6 @@ module .exports = class AnimationEditor extends Interface
416
417
 
417
418
  this .setSelection (require ("../Application/Selection"));
418
419
  this .zoomFit ();
419
- this .resizeTimeline ();
420
420
  this .requestDrawTimeline ();
421
421
 
422
422
  this .browser .nextFrame () .then (() => this .setCurrentFrame (0));
@@ -730,12 +730,9 @@ module .exports = class AnimationEditor extends Interface
730
730
 
731
731
  for (const route of interpolator ._value_changed .getOutputRoutes ())
732
732
  {
733
- const node = route .getDestinationNode ();
734
-
735
- if (!(node instanceof X3D .X3DNode))
736
- continue;
737
-
738
- const field = node .getField (route .getDestinationField ());
733
+ const
734
+ node = route .getDestinationNode (),
735
+ field = node .getField (route .getDestinationField ());
739
736
 
740
737
  this .members .add (node);
741
738
  this .fields .set (field, interpolator);
@@ -2341,6 +2338,9 @@ module .exports = class AnimationEditor extends Interface
2341
2338
 
2342
2339
  on_mousedown (event)
2343
2340
  {
2341
+ if (!this .animation)
2342
+ return;
2343
+
2344
2344
  $(document)
2345
2345
  .on ("mousemove.AnimationEditor", event => this .updatePointer (event))
2346
2346
  .on ("mouseup.AnimationEditor", event => this .on_mouseup (event))
@@ -2405,6 +2405,9 @@ module .exports = class AnimationEditor extends Interface
2405
2405
 
2406
2406
  on_mouseup (event)
2407
2407
  {
2408
+ if (!this .animation)
2409
+ return;
2410
+
2408
2411
  $(document) .off (".AnimationEditor");
2409
2412
 
2410
2413
  this .updatePointer (event);
@@ -2421,6 +2424,9 @@ module .exports = class AnimationEditor extends Interface
2421
2424
 
2422
2425
  on_mousemove (event)
2423
2426
  {
2427
+ if (!this .animation)
2428
+ return;
2429
+
2424
2430
  switch (this .#button)
2425
2431
  {
2426
2432
  case undefined:
@@ -2440,6 +2446,9 @@ module .exports = class AnimationEditor extends Interface
2440
2446
 
2441
2447
  on_wheel (event)
2442
2448
  {
2449
+ if (!this .animation)
2450
+ return;
2451
+
2443
2452
  const deltaY = event .originalEvent .deltaY;
2444
2453
 
2445
2454
  this .updatePointer (event);
@@ -2859,190 +2868,190 @@ module .exports = class AnimationEditor extends Interface
2859
2868
  context .scale (contentScale, contentScale);
2860
2869
  context .clearRect (0, 0, tracksWidth, tracksHeight);
2861
2870
 
2862
- if (!this .animation)
2863
- return;
2864
-
2865
- const
2866
- left = this .getLeft (),
2867
- width = this .getWidth (),
2868
- translation = this .getTranslation (),
2869
- scale = this .getScale (),
2870
- trackOffsets = this .memberList .getTrackOffsets (),
2871
- firstFrame = Math .max (0, Math .floor (-translation / scale)),
2872
- lastFrame = Math .min (this .getDuration (), Math .ceil ((width - translation) / scale)) + 1;
2873
-
2874
- const [frameStep, frameFactor] = this .getFrameParams ();
2875
-
2876
- const
2877
- blue = this .#style .getPropertyValue ("--system-blue"),
2878
- indigo = this .#style .getPropertyValue ("--system-indigo"),
2879
- orange = this .#style .getPropertyValue ("--system-orange"),
2880
- brown = this .#style .getPropertyValue ("--system-brown"),
2881
- red = this .#style .getPropertyValue ("--system-red"),
2882
- range = this .#style .getPropertyValue ("--selection-range"),
2883
- tint1 = this .#style .getPropertyValue ("--tint-color1"),
2884
- tint2 = this .#style .getPropertyValue ("--tint-color2");
2871
+ if (this .animation)
2872
+ {
2873
+ const
2874
+ left = this .getLeft (),
2875
+ width = this .getWidth (),
2876
+ translation = this .getTranslation (),
2877
+ scale = this .getScale (),
2878
+ trackOffsets = this .memberList .getTrackOffsets (),
2879
+ firstFrame = Math .max (0, Math .floor (-translation / scale)),
2880
+ lastFrame = Math .min (this .getDuration (), Math .ceil ((width - translation) / scale)) + 1;
2885
2881
 
2886
- // Draw selection range.
2882
+ const [frameStep, frameFactor] = this .getFrameParams ();
2887
2883
 
2888
- context .save ();
2889
- context .clip (this .timelineClip);
2884
+ const
2885
+ blue = this .#style .getPropertyValue ("--system-blue"),
2886
+ indigo = this .#style .getPropertyValue ("--system-indigo"),
2887
+ orange = this .#style .getPropertyValue ("--system-orange"),
2888
+ brown = this .#style .getPropertyValue ("--system-brown"),
2889
+ red = this .#style .getPropertyValue ("--system-red"),
2890
+ range = this .#style .getPropertyValue ("--selection-range"),
2891
+ tint1 = this .#style .getPropertyValue ("--tint-color1"),
2892
+ tint2 = this .#style .getPropertyValue ("--tint-color2");
2890
2893
 
2891
- const selectionRange = this .getSelectionRange ();
2894
+ // Draw selection range.
2892
2895
 
2893
- if (selectionRange [0] !== selectionRange [1])
2894
- {
2895
- const minFrame = X3D .Algorithm .clamp (selectionRange [0], firstFrame, lastFrame - 1);
2896
- const maxFrame = X3D .Algorithm .clamp (selectionRange [1], firstFrame, lastFrame - 1);
2897
- const x0 = left + minFrame * scale + translation;
2898
- const x1 = left + maxFrame * scale + translation;
2896
+ context .save ();
2897
+ context .clip (this .timelineClip);
2899
2898
 
2900
- context .fillStyle = range;
2899
+ const selectionRange = this .getSelectionRange ();
2901
2900
 
2902
- context .fillRect (Math .min (x0, x1) - 1, 0, Math .abs (x1 - x0) + 3, tracksHeight);
2903
- }
2901
+ if (selectionRange [0] !== selectionRange [1])
2902
+ {
2903
+ const minFrame = X3D .Algorithm .clamp (selectionRange [0], firstFrame, lastFrame - 1);
2904
+ const maxFrame = X3D .Algorithm .clamp (selectionRange [1], firstFrame, lastFrame - 1);
2905
+ const x0 = left + minFrame * scale + translation;
2906
+ const x1 = left + maxFrame * scale + translation;
2904
2907
 
2905
- context .restore ();
2908
+ context .fillStyle = range;
2906
2909
 
2907
- // Draw all tracks.
2910
+ context .fillRect (Math .min (x0, x1) - 1, 0, Math .abs (x1 - x0) + 3, tracksHeight);
2911
+ }
2908
2912
 
2909
- for (const [i, { item, top, bottom, height }] of trackOffsets .entries ())
2910
- {
2911
- // Track
2913
+ context .restore ();
2912
2914
 
2913
- const odd = item .data ("i") % 2;
2915
+ // Draw all tracks.
2914
2916
 
2915
- if (odd || i === 0)
2917
+ for (const [i, { item, top, bottom, height }] of trackOffsets .entries ())
2916
2918
  {
2917
- // Draw a line below last field.
2919
+ // Track
2918
2920
 
2919
- if (trackOffsets [i + 1] ?.item .hasClass ("node") ?? true)
2921
+ const odd = item .data ("i") % 2;
2922
+
2923
+ if (odd || i === 0)
2920
2924
  {
2921
- context .fillStyle = tint2;
2925
+ // Draw a line below last field.
2922
2926
 
2923
- context .fillRect (0, bottom - 1, tracksWidth, 1);
2924
- }
2925
- }
2926
- else if (item .hasClass ("field"))
2927
- {
2928
- // Draw a bar.
2927
+ if (trackOffsets [i + 1] ?.item .hasClass ("node") ?? true)
2928
+ {
2929
+ context .fillStyle = tint2;
2929
2930
 
2930
- context .fillStyle = tint1;
2931
+ context .fillRect (0, bottom - 1, tracksWidth, 1);
2932
+ }
2933
+ }
2934
+ else if (item .hasClass ("field"))
2935
+ {
2936
+ // Draw a bar.
2931
2937
 
2932
- context .fillRect (0, top, tracksWidth, height);
2933
- }
2938
+ context .fillStyle = tint1;
2934
2939
 
2935
- // Highlight track on hover.
2940
+ context .fillRect (0, top, tracksWidth, height);
2941
+ }
2936
2942
 
2937
- const hover = this .pointer .y > top && this .pointer .y < bottom;
2943
+ // Highlight track on hover.
2938
2944
 
2939
- if (hover)
2940
- item .addClass ("hover-track");
2941
- else
2942
- item .removeClass ("hover-track");
2945
+ const hover = this .pointer .y > top && this .pointer .y < bottom;
2943
2946
 
2944
- if (item .is (".hover, .hover-tracks") || hover)
2945
- {
2946
- context .fillStyle = tint2;
2947
+ if (hover)
2948
+ item .addClass ("hover-track");
2949
+ else
2950
+ item .removeClass ("hover-track");
2947
2951
 
2948
- context .fillRect (0, top, tracksWidth, height);
2949
- }
2952
+ if (item .is (".hover, .hover-tracks") || hover)
2953
+ {
2954
+ context .fillStyle = tint2;
2950
2955
 
2951
- // Frames
2956
+ context .fillRect (0, top, tracksWidth, height);
2957
+ }
2952
2958
 
2953
- context .save ();
2954
- context .clip (this .timelineClip);
2959
+ // Frames
2955
2960
 
2956
- // Draw vertical lines.
2961
+ context .save ();
2962
+ context .clip (this .timelineClip);
2957
2963
 
2958
- context .strokeStyle = item .hasClass ("main") ? indigo : blue;
2959
- context .lineWidth = item .is (".main, .node") ? 3 : 1;
2964
+ // Draw vertical lines.
2960
2965
 
2961
- for (let frame = firstFrame - (firstFrame % frameStep); frame < lastFrame; frame += frameStep)
2962
- {
2963
- const s = frame % frameFactor; // size (large or small)
2964
- const y = Math .floor (top + height * (s ? 0.75 : 0.5));
2965
- const x = Math .floor (left + this .getPointerFromFrame (frame));
2966
+ context .strokeStyle = item .hasClass ("main") ? indigo : blue;
2967
+ context .lineWidth = item .is (".main, .node") ? 3 : 1;
2966
2968
 
2967
- context .beginPath ();
2968
- context .moveTo (x + 0.5, y - this .TRACK_PADDING);
2969
- context .lineTo (x + 0.5, bottom - this .TRACK_PADDING);
2970
- context .stroke ();
2971
- }
2969
+ for (let frame = firstFrame - (firstFrame % frameStep); frame < lastFrame; frame += frameStep)
2970
+ {
2971
+ const s = frame % frameFactor; // size (large or small)
2972
+ const y = Math .floor (top + height * (s ? 0.75 : 0.5));
2973
+ const x = Math .floor (left + this .getPointerFromFrame (frame));
2974
+
2975
+ context .beginPath ();
2976
+ context .moveTo (x + 0.5, y - this .TRACK_PADDING);
2977
+ context .lineTo (x + 0.5, bottom - this .TRACK_PADDING);
2978
+ context .stroke ();
2979
+ }
2972
2980
 
2973
- // Draw keyframes.
2981
+ // Draw keyframes.
2974
2982
 
2975
- switch (item .attr ("type"))
2976
- {
2977
- case "main":
2983
+ switch (item .attr ("type"))
2978
2984
  {
2979
- for (const field of this .fields .keys ())
2980
- this .drawKeyframes (context, field, firstFrame, lastFrame, bottom - this .TRACK_PADDING, brown);
2985
+ case "main":
2986
+ {
2987
+ for (const field of this .fields .keys ())
2988
+ this .drawKeyframes (context, field, firstFrame, lastFrame, bottom - this .TRACK_PADDING, brown);
2981
2989
 
2982
- break;
2983
- }
2984
- case "node":
2985
- {
2986
- const node = item .data ("node");
2990
+ break;
2991
+ }
2992
+ case "node":
2993
+ {
2994
+ const node = item .data ("node");
2987
2995
 
2988
- for (const field of node .getFields ())
2989
- this .drawKeyframes (context, field, firstFrame, lastFrame, bottom - this .TRACK_PADDING, brown);
2996
+ for (const field of node .getFields ())
2997
+ this .drawKeyframes (context, field, firstFrame, lastFrame, bottom - this .TRACK_PADDING, brown);
2990
2998
 
2991
- break;
2992
- }
2993
- case "field":
2994
- {
2995
- this .drawKeyframes (context, item .data ("field"), firstFrame, lastFrame, bottom - this .TRACK_PADDING, orange);
2996
- break;
2999
+ break;
3000
+ }
3001
+ case "field":
3002
+ {
3003
+ this .drawKeyframes (context, item .data ("field"), firstFrame, lastFrame, bottom - this .TRACK_PADDING, orange);
3004
+ break;
3005
+ }
2997
3006
  }
2998
- }
2999
3007
 
3000
- // Draw selected keyframes.
3008
+ // Draw selected keyframes.
3001
3009
 
3002
- switch (item .attr ("type"))
3003
- {
3004
- case "main":
3010
+ switch (item .attr ("type"))
3005
3011
  {
3006
- const fields = new Set (this .fields .keys ());
3012
+ case "main":
3013
+ {
3014
+ const fields = new Set (this .fields .keys ());
3007
3015
 
3008
- this .drawSelectedKeyframes (context, fields, bottom - this .TRACK_PADDING, red);
3009
- break;
3010
- }
3011
- case "node":
3012
- {
3013
- const
3014
- node = item .data ("node"),
3015
- fields = new Set (node .getFields ());
3016
+ this .drawSelectedKeyframes (context, fields, bottom - this .TRACK_PADDING, red);
3017
+ break;
3018
+ }
3019
+ case "node":
3020
+ {
3021
+ const
3022
+ node = item .data ("node"),
3023
+ fields = new Set (node .getFields ());
3016
3024
 
3017
- this .drawSelectedKeyframes (context, fields, bottom - this .TRACK_PADDING, red);
3018
- break;
3019
- }
3020
- case "field":
3021
- {
3022
- const fields = new Set ([item .data ("field")]);
3025
+ this .drawSelectedKeyframes (context, fields, bottom - this .TRACK_PADDING, red);
3026
+ break;
3027
+ }
3028
+ case "field":
3029
+ {
3030
+ const fields = new Set ([item .data ("field")]);
3023
3031
 
3024
- this .drawSelectedKeyframes (context, fields, bottom - this .TRACK_PADDING, red);
3025
- break;
3032
+ this .drawSelectedKeyframes (context, fields, bottom - this .TRACK_PADDING, red);
3033
+ break;
3034
+ }
3026
3035
  }
3027
- }
3028
3036
 
3029
- context .restore ();
3030
- }
3037
+ context .restore ();
3038
+ }
3031
3039
 
3032
- // Draw current frame cursor.
3040
+ // Draw current frame cursor.
3033
3041
 
3034
- context .save ();
3035
- context .clip (this .timelineClip);
3042
+ context .save ();
3043
+ context .clip (this .timelineClip);
3036
3044
 
3037
- const frame = this .getCurrentFrame ();
3038
- const x = Math .floor (left + this .getPointerFromFrame (frame));
3045
+ const frame = this .getCurrentFrame ();
3046
+ const x = Math .floor (left + this .getPointerFromFrame (frame));
3039
3047
 
3040
- context .fillStyle = blue;
3048
+ context .fillStyle = blue;
3041
3049
 
3042
- context .fillRect (x - 1, 0, 3, tracksHeight);
3050
+ context .fillRect (x - 1, 0, 3, tracksHeight);
3051
+ context .restore ();
3052
+ }
3043
3053
 
3044
3054
  context .restore ();
3045
- context .restore ();
3046
3055
  }
3047
3056
 
3048
3057
  #defaultIntegers = new X3D .MFInt32 ();