lexgui 0.1.13 → 0.1.15
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.
- package/build/components/codeeditor.js +353 -207
- package/build/components/timeline.js +104 -68
- package/build/lexgui.css +46 -14
- package/build/lexgui.js +29 -19
- package/build/lexgui.module.js +30 -19
- package/examples/code_editor.html +7 -2
- package/package.json +1 -1
|
@@ -69,7 +69,7 @@ class Timeline {
|
|
|
69
69
|
this.currentScroll = 0; //in percentage
|
|
70
70
|
this.currentScrollInPixels = 0; //in pixels
|
|
71
71
|
this.scrollableHeight = this.size[1]; //true height of the timeline content
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
this.secondsToPixels = this.canvas.width/this.duration;
|
|
74
74
|
this.pixelsToSeconds = 1 / this.secondsToPixels;
|
|
75
75
|
this.selectedItems = options.selectedItems ?? null;
|
|
@@ -145,7 +145,7 @@ class Timeline {
|
|
|
145
145
|
LX.DEFAULT_NAME_WIDTH = "50%";
|
|
146
146
|
header.sameLine();
|
|
147
147
|
header.addTitle(this.name);
|
|
148
|
-
|
|
148
|
+
|
|
149
149
|
header.addNumber("Current Time", this.currentTime, (value, event) => {
|
|
150
150
|
if(value > this.duration) {
|
|
151
151
|
value = this.duration;
|
|
@@ -236,7 +236,7 @@ class Timeline {
|
|
|
236
236
|
'callback': (el, node) => {
|
|
237
237
|
// TO DO (apply functionality)
|
|
238
238
|
let value = el.classList.contains('fa-lock');
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
if(value) {
|
|
241
241
|
el.title = 'Lock edition';
|
|
242
242
|
el.classList.remove('fa-lock');
|
|
@@ -260,7 +260,7 @@ class Timeline {
|
|
|
260
260
|
this.onLockTrack(el, track, node)
|
|
261
261
|
this.draw();
|
|
262
262
|
}
|
|
263
|
-
|
|
263
|
+
|
|
264
264
|
}]})
|
|
265
265
|
// panel.addTitle(track.name + (track.type? '(' + track.type + ')' : ''));
|
|
266
266
|
}
|
|
@@ -284,9 +284,9 @@ class Timeline {
|
|
|
284
284
|
panel.attach(p.root)
|
|
285
285
|
p.root.style.overflowY = "scroll";
|
|
286
286
|
p.root.addEventListener("scroll", (e) => {
|
|
287
|
-
|
|
287
|
+
|
|
288
288
|
this.currentScroll = e.currentTarget.scrollTop/(e.currentTarget.scrollHeight - e.currentTarget.clientHeight);
|
|
289
|
-
|
|
289
|
+
})
|
|
290
290
|
// for(let i = 0; i < this.animationClip.tracks.length; i++) {
|
|
291
291
|
// let track = this.animationClip.tracks[i];
|
|
292
292
|
// panel.addTitle(track.name + (track.type? '(' + track.type + ')' : ''));
|
|
@@ -751,7 +751,7 @@ class Timeline {
|
|
|
751
751
|
// if(!this.grabbing_timeline && !this.movingKeys)
|
|
752
752
|
// this.canvas.style.cursor = "default";
|
|
753
753
|
|
|
754
|
-
|
|
754
|
+
|
|
755
755
|
let timeX = this.timeToX( this.currentTime );
|
|
756
756
|
let current_grabbing_timeline = localY < this.topMargin && localX > this.session.left_margin &&
|
|
757
757
|
localX > (timeX - 6) && localX < (timeX + 6);
|
|
@@ -761,7 +761,7 @@ class Timeline {
|
|
|
761
761
|
else if(this.movingKeys) {
|
|
762
762
|
this.canvas.style.cursor = "grabbing";
|
|
763
763
|
}
|
|
764
|
-
|
|
764
|
+
else
|
|
765
765
|
this.canvas.style.cursor = "default";
|
|
766
766
|
|
|
767
767
|
if( e.type == "wheel" ) {
|
|
@@ -798,7 +798,7 @@ class Timeline {
|
|
|
798
798
|
e.localX = localX;
|
|
799
799
|
e.localY = localY;
|
|
800
800
|
|
|
801
|
-
|
|
801
|
+
|
|
802
802
|
|
|
803
803
|
const innerSetTime = (t) => {
|
|
804
804
|
LX.emit( "@on_current_time_" + this.constructor.name, t);
|
|
@@ -1051,7 +1051,7 @@ class Timeline {
|
|
|
1051
1051
|
let trackAlpha = 1;
|
|
1052
1052
|
|
|
1053
1053
|
if(clips) {
|
|
1054
|
-
|
|
1054
|
+
|
|
1055
1055
|
for(var j = 0; j < clips.length; ++j)
|
|
1056
1056
|
{
|
|
1057
1057
|
selectedClipArea = null;
|
|
@@ -1069,10 +1069,10 @@ class Timeline {
|
|
|
1069
1069
|
ctx.fillStyle = clip.clipColor || "#5e9fdd"//#333";
|
|
1070
1070
|
//ctx.fillRect(x,y,w,trackHeight);
|
|
1071
1071
|
ctx.roundRect( x, y + offset, w, trackHeight , 5, true);
|
|
1072
|
-
|
|
1072
|
+
|
|
1073
1073
|
let fadeinX = this.secondsToPixels * ((clip.fadein || 0) - clip.start);
|
|
1074
1074
|
let fadeoutX = this.secondsToPixels * (clip.start + clip.duration - (clip.fadeout || (clip.start + clip.duration)));
|
|
1075
|
-
|
|
1075
|
+
|
|
1076
1076
|
let color = LX.UTILS.HexToRgb(ctx.fillStyle);
|
|
1077
1077
|
color = color.map(x => x*=0.8);
|
|
1078
1078
|
ctx.fillStyle = 'rgba(' + color.join(',') + ', 0.8)';
|
|
@@ -1081,7 +1081,7 @@ class Timeline {
|
|
|
1081
1081
|
ctx.roundRect(x, y + offset, fadeinX, trackHeight, {tl: 5, bl: 5, tr:0, br:0}, true);
|
|
1082
1082
|
if(fadeoutX)
|
|
1083
1083
|
ctx.roundRect( x + w - fadeoutX, y + offset, fadeoutX, trackHeight, {tl: 0, bl: 0, tr:5, br:5}, true);
|
|
1084
|
-
|
|
1084
|
+
|
|
1085
1085
|
//draw clip outline
|
|
1086
1086
|
if(clip.hidden)
|
|
1087
1087
|
ctx.globalAlpha = trackAlpha * 0.5;
|
|
@@ -1210,7 +1210,7 @@ class Timeline {
|
|
|
1210
1210
|
if(tracks[i].type != type && tracks.length > 1)
|
|
1211
1211
|
continue;
|
|
1212
1212
|
this.tracksPerItem[name][i].hide = hide;
|
|
1213
|
-
|
|
1213
|
+
// trackInfo = this.tracksPerItem[name][i];
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
1216
|
|
|
@@ -1238,7 +1238,7 @@ class Timeline {
|
|
|
1238
1238
|
this.resizeCanvas([w , size[1]]);
|
|
1239
1239
|
|
|
1240
1240
|
// this.session.start_time = 0;
|
|
1241
|
-
|
|
1241
|
+
|
|
1242
1242
|
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
@@ -1537,7 +1537,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1537
1537
|
title: "Copy",// + " <i class='bi bi-clipboard-fill float-right'></i>",
|
|
1538
1538
|
callback: () => {
|
|
1539
1539
|
this.copyContent();
|
|
1540
|
-
|
|
1540
|
+
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
1543
|
)
|
|
@@ -1609,7 +1609,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
offset += offsetI * height + height;
|
|
1611
1611
|
}
|
|
1612
|
-
|
|
1612
|
+
|
|
1613
1613
|
ctx.restore();
|
|
1614
1614
|
};
|
|
1615
1615
|
|
|
@@ -1700,7 +1700,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1700
1700
|
|
|
1701
1701
|
track.optimize( this.optimizeThreshold );
|
|
1702
1702
|
if(this.onOptimizeTracks)
|
|
1703
|
-
|
|
1703
|
+
this.onOptimizeTracks(trackIdx);
|
|
1704
1704
|
}
|
|
1705
1705
|
}
|
|
1706
1706
|
|
|
@@ -1901,7 +1901,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1901
1901
|
return this.clipboard != null;
|
|
1902
1902
|
}
|
|
1903
1903
|
|
|
1904
|
-
|
|
1904
|
+
#paste( track, index ) {
|
|
1905
1905
|
|
|
1906
1906
|
let clipboardInfo = this.clipboard.value;
|
|
1907
1907
|
|
|
@@ -1927,7 +1927,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1927
1927
|
this.saveState(track.clipIdx);
|
|
1928
1928
|
|
|
1929
1929
|
// Copy to current key
|
|
1930
|
-
this
|
|
1930
|
+
this.#paste( track, index );
|
|
1931
1931
|
|
|
1932
1932
|
if(!e.multipleSelection)
|
|
1933
1933
|
return;
|
|
@@ -1937,7 +1937,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1937
1937
|
|
|
1938
1938
|
// Copy to every selected key
|
|
1939
1939
|
for(let [name, idx, keyIndex] of this.lastKeyFramesSelected) {
|
|
1940
|
-
this
|
|
1940
|
+
this.#paste( this.tracksPerItem[name][idx], keyIndex );
|
|
1941
1941
|
}
|
|
1942
1942
|
}
|
|
1943
1943
|
|
|
@@ -1966,7 +1966,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
1966
1966
|
|
|
1967
1967
|
// Copy to every selected key
|
|
1968
1968
|
for(let [name, idx, keyIndex] of this.lastKeyFramesSelected) {
|
|
1969
|
-
this
|
|
1969
|
+
this.#paste( this.tracksPerItem[name][idx], keyIndex );
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
1972
|
|
|
@@ -2019,7 +2019,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2019
2019
|
}
|
|
2020
2020
|
|
|
2021
2021
|
this.animationClip.tracks[clipIdx].times = new Float32Array( timesArray );
|
|
2022
|
-
|
|
2022
|
+
|
|
2023
2023
|
// Add values
|
|
2024
2024
|
let valuesArray = [];
|
|
2025
2025
|
let dim = value.length;
|
|
@@ -2070,7 +2070,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2070
2070
|
* @track: track that keyframe belongs to
|
|
2071
2071
|
* @index: index of the keyframe on the track
|
|
2072
2072
|
*/
|
|
2073
|
-
|
|
2073
|
+
#delete( track, index ) {
|
|
2074
2074
|
|
|
2075
2075
|
// Don't remove by now the first key
|
|
2076
2076
|
if(index == 0) {
|
|
@@ -2138,7 +2138,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2138
2138
|
// Delete every selected key
|
|
2139
2139
|
for(let [name, idx, keyIndex] of pts) {
|
|
2140
2140
|
this.saveState(this.tracksPerItem[name][idx].clipIdx);
|
|
2141
|
-
deletedIndices += this
|
|
2141
|
+
deletedIndices += this.#delete( this.tracksPerItem[name][idx], keyIndex - deletedIndices );
|
|
2142
2142
|
}
|
|
2143
2143
|
}
|
|
2144
2144
|
}
|
|
@@ -2153,7 +2153,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2153
2153
|
|
|
2154
2154
|
if ( track ){
|
|
2155
2155
|
this.saveState(track.clipIdx);
|
|
2156
|
-
this
|
|
2156
|
+
this.#delete( track, index );
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
2159
|
|
|
@@ -2358,7 +2358,7 @@ class KeyFramesTimeline extends Timeline {
|
|
|
2358
2358
|
for(let i = count - 1; i >= 0; i--)
|
|
2359
2359
|
{
|
|
2360
2360
|
this.saveState(track.clipIdx);
|
|
2361
|
-
this
|
|
2361
|
+
this.#delete(track, i );
|
|
2362
2362
|
}
|
|
2363
2363
|
if(defaultValue != undefined) {
|
|
2364
2364
|
if(typeof(defaultValue) == 'number') {
|
|
@@ -2424,7 +2424,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2424
2424
|
}
|
|
2425
2425
|
|
|
2426
2426
|
this.draw(this.currentTime);
|
|
2427
|
-
|
|
2427
|
+
|
|
2428
2428
|
}
|
|
2429
2429
|
|
|
2430
2430
|
onMouseUp( e ) {
|
|
@@ -2535,10 +2535,12 @@ class ClipsTimeline extends Timeline {
|
|
|
2535
2535
|
//this.addUndoStep( "clip_modified", clip );
|
|
2536
2536
|
if( (e.ctrlKey && distToStart < 5) || (clip.fadein && Math.abs( this.timeToX( clip.start + clip.fadein ) - e.offsetX ) < 5) )
|
|
2537
2537
|
this.dragClipMode = "fadein";
|
|
2538
|
-
else if(
|
|
2539
|
-
this.dragClipMode = "fadeout";
|
|
2540
|
-
else if( Math.abs( endingX - x ) < 10 )
|
|
2538
|
+
else if(e.ctrlKey && Math.abs( endingX - x ) < 5 ) {
|
|
2541
2539
|
this.dragClipMode = "duration";
|
|
2540
|
+
this.canvas.style.cursor = "column-resize";
|
|
2541
|
+
}
|
|
2542
|
+
else if( (e.ctrlKey && distToEnd < 10) || (clip.fadeout && Math.abs( this.timeToX( clip.start + clip.duration - clip.fadeout ) - e.offsetX ) < 5) )
|
|
2543
|
+
this.dragClipMode = "fadeout";
|
|
2542
2544
|
else
|
|
2543
2545
|
this.dragClipMode = "move";
|
|
2544
2546
|
}
|
|
@@ -2584,7 +2586,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2584
2586
|
var curr = time - this.currentTime;
|
|
2585
2587
|
var delta = curr - this.grabTime;
|
|
2586
2588
|
this.grabTime = curr;
|
|
2587
|
-
|
|
2589
|
+
|
|
2588
2590
|
var ct = Math.max(0,this.currentTime - delta);
|
|
2589
2591
|
if( this.timelineClickedClips != undefined) {
|
|
2590
2592
|
this.movingKeys = true;
|
|
@@ -2611,7 +2613,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2611
2613
|
// for(let i = 0; i < tracks.length; i++) {
|
|
2612
2614
|
let clips = this.getClipsInRange(e.track, clip.start, clip.start + clip.duration, 0.01)
|
|
2613
2615
|
if(clips == undefined || !clips.length) {
|
|
2614
|
-
|
|
2616
|
+
// let newClip = Object.assign({}, clip);
|
|
2615
2617
|
let clipIndex = this.addClipInTrack(clip, e.track.idx);
|
|
2616
2618
|
this.deleteClip(clip);
|
|
2617
2619
|
e.track.selected[clipIndex] = true;
|
|
@@ -2626,11 +2628,16 @@ class ClipsTimeline extends Timeline {
|
|
|
2626
2628
|
}
|
|
2627
2629
|
}
|
|
2628
2630
|
else if( this.dragClipMode == "fadein" )
|
|
2629
|
-
clip.fadein = Math.min(Math.max((clip.fadein || 0) +
|
|
2631
|
+
clip.fadein = Math.min(Math.max((clip.fadein || 0) + delta, clip.start), clip.start+clip.duration);
|
|
2630
2632
|
else if( this.dragClipMode == "fadeout" )
|
|
2631
|
-
clip.fadeout = Math.max(Math.min((clip.fadeout || clip.start+clip.duration) +
|
|
2632
|
-
else if( this.dragClipMode == "duration" )
|
|
2633
|
-
clip.duration +=
|
|
2633
|
+
clip.fadeout = Math.max(Math.min((clip.fadeout || clip.start+clip.duration) + delta, clip.start+clip.duration), clip.start);
|
|
2634
|
+
else if( this.dragClipMode == "duration" ) {
|
|
2635
|
+
clip.duration += delta;
|
|
2636
|
+
clip.fadeout += delta;
|
|
2637
|
+
if(this.onContentMoved) {
|
|
2638
|
+
this.onContentMoved(clip, 0);
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2634
2641
|
|
|
2635
2642
|
if(this.duration < clip.start + clip.duration )
|
|
2636
2643
|
{
|
|
@@ -2642,6 +2649,14 @@ class ClipsTimeline extends Timeline {
|
|
|
2642
2649
|
else{
|
|
2643
2650
|
innerSetTime( this.currentTime );
|
|
2644
2651
|
}
|
|
2652
|
+
}
|
|
2653
|
+
else if(e.track && e.ctrlKey) {
|
|
2654
|
+
for(let i = 0; i < e.track.clips.length; i++) {
|
|
2655
|
+
let clip = e.track.clips[i];
|
|
2656
|
+
const x = this.timeToX(clip.start+clip.duration);
|
|
2657
|
+
if(Math.abs(e.localX - x) < 5)
|
|
2658
|
+
this.canvas.style.cursor = "col-resize";
|
|
2659
|
+
}
|
|
2645
2660
|
}
|
|
2646
2661
|
}
|
|
2647
2662
|
|
|
@@ -2712,7 +2727,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2712
2727
|
let tracks = this.animationClip.tracks|| [{name: "NMF", clips: []}];
|
|
2713
2728
|
if(!tracks)
|
|
2714
2729
|
return;
|
|
2715
|
-
|
|
2730
|
+
|
|
2716
2731
|
const height = this.trackHeight;
|
|
2717
2732
|
|
|
2718
2733
|
this.scrollableHeight = (tracks.length)*height + this.topMargin;
|
|
@@ -2725,7 +2740,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2725
2740
|
}
|
|
2726
2741
|
|
|
2727
2742
|
ctx.restore();
|
|
2728
|
-
|
|
2743
|
+
|
|
2729
2744
|
}
|
|
2730
2745
|
|
|
2731
2746
|
// Creates a map for each item -> tracks
|
|
@@ -2903,8 +2918,8 @@ class ClipsTimeline extends Timeline {
|
|
|
2903
2918
|
this.setDuration(end);
|
|
2904
2919
|
}
|
|
2905
2920
|
|
|
2906
|
-
|
|
2907
|
-
|
|
2921
|
+
// // Update animation action interpolation info
|
|
2922
|
+
if(this.onUpdateTrack)
|
|
2908
2923
|
this.onUpdateTrack( trackIdx );
|
|
2909
2924
|
|
|
2910
2925
|
LX.emit( "@on_current_time_" + this.constructor.name, this.currentTime);
|
|
@@ -2921,13 +2936,13 @@ class ClipsTimeline extends Timeline {
|
|
|
2921
2936
|
return newIdx;
|
|
2922
2937
|
}
|
|
2923
2938
|
|
|
2924
|
-
|
|
2939
|
+
/** Add a clip to the timeline in a free track slot at the current time
|
|
2925
2940
|
* @clip: clip to be added
|
|
2926
2941
|
* @trackIdx: track index where to add the track
|
|
2927
2942
|
* @offsetTime: (optional) offset time of current time
|
|
2928
2943
|
* @callback: (optional) function to call after adding the clip
|
|
2929
2944
|
*/
|
|
2930
|
-
|
|
2945
|
+
addClipInTrack( clip, trackIdx, offsetTime = 0, callback = null ) {
|
|
2931
2946
|
|
|
2932
2947
|
// Time slot with other clip?
|
|
2933
2948
|
if(!this.animationClip)
|
|
@@ -2965,7 +2980,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2965
2980
|
track.selected[newIdx] = undefined;
|
|
2966
2981
|
track.edited[newIdx] = undefined;
|
|
2967
2982
|
|
|
2968
|
-
|
|
2983
|
+
|
|
2969
2984
|
let end = clip.start + clip.duration;
|
|
2970
2985
|
|
|
2971
2986
|
if( end > this.duration || !this.animationClip.duration)
|
|
@@ -2973,8 +2988,8 @@ class ClipsTimeline extends Timeline {
|
|
|
2973
2988
|
this.setDuration(end);
|
|
2974
2989
|
}
|
|
2975
2990
|
|
|
2976
|
-
|
|
2977
|
-
|
|
2991
|
+
// // Update animation action interpolation info
|
|
2992
|
+
if(this.onUpdateTrack)
|
|
2978
2993
|
this.onUpdateTrack( trackIdx );
|
|
2979
2994
|
|
|
2980
2995
|
LX.emit( "@on_current_time_" + this.constructor.name, this.currentTime);
|
|
@@ -2992,7 +3007,7 @@ class ClipsTimeline extends Timeline {
|
|
|
2992
3007
|
* @callback: (optional) function to call after adding the clip
|
|
2993
3008
|
*/
|
|
2994
3009
|
addClips( clips, offsetTime = 0, callback = null ) {
|
|
2995
|
-
|
|
3010
|
+
|
|
2996
3011
|
if(!this.animationClip)
|
|
2997
3012
|
this.addNewTrack();
|
|
2998
3013
|
|
|
@@ -3021,7 +3036,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3021
3036
|
console.warn("There is already a clip stored in time slot ", clipInCurrentSlot)
|
|
3022
3037
|
if(!this.animationClip.tracks[i+1]) {
|
|
3023
3038
|
this.addNewTrack();
|
|
3024
|
-
|
|
3039
|
+
|
|
3025
3040
|
trackIdxs[c] = {trackIdx: i+1, stat: newStart, end: newStart + clip.duration};
|
|
3026
3041
|
}
|
|
3027
3042
|
else {
|
|
@@ -3188,7 +3203,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3188
3203
|
// Delete every selected clip
|
|
3189
3204
|
for(let [trackIdx, clipIdx] of pts) {
|
|
3190
3205
|
this.saveState(trackIdx, clipIdx);
|
|
3191
|
-
this
|
|
3206
|
+
this.#delete(trackIdx, clipIdx );
|
|
3192
3207
|
deletedIndices++;
|
|
3193
3208
|
}
|
|
3194
3209
|
}
|
|
@@ -3197,7 +3212,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3197
3212
|
const [trackIdx, clipIdx] = clip;
|
|
3198
3213
|
|
|
3199
3214
|
this.saveState(trackIdx, clipIdx);
|
|
3200
|
-
this
|
|
3215
|
+
this.#delete( trackIdx, clipIdx );
|
|
3201
3216
|
}
|
|
3202
3217
|
|
|
3203
3218
|
|
|
@@ -3211,7 +3226,7 @@ class ClipsTimeline extends Timeline {
|
|
|
3211
3226
|
|
|
3212
3227
|
}
|
|
3213
3228
|
|
|
3214
|
-
|
|
3229
|
+
#delete( trackIdx, clipIdx) {
|
|
3215
3230
|
|
|
3216
3231
|
let clips = this.animationClip.tracks[trackIdx].clips;
|
|
3217
3232
|
if(clipIdx >= 0)
|
|
@@ -3306,8 +3321,16 @@ class ClipsTimeline extends Timeline {
|
|
|
3306
3321
|
clips: [],
|
|
3307
3322
|
selected: [], edited: [], hovered: []
|
|
3308
3323
|
};
|
|
3309
|
-
|
|
3324
|
+
//delete all selectedclips
|
|
3310
3325
|
this.animationClip.tracks[idx] = trackInfo;
|
|
3326
|
+
let selected = [];
|
|
3327
|
+
for(let i = 0; i < this.lastClipsSelected.length; i++) {
|
|
3328
|
+
let [trackIdx, clipIdx] = this.lastClipsSelected[i];
|
|
3329
|
+
if(trackIdx != idx)
|
|
3330
|
+
selected.push(this.lastClipsSelected[i]);
|
|
3331
|
+
|
|
3332
|
+
}
|
|
3333
|
+
this.lastClipsSelected = selected;
|
|
3311
3334
|
return trackInfo.idx;
|
|
3312
3335
|
}
|
|
3313
3336
|
|
|
@@ -3372,6 +3395,19 @@ class ClipsTimeline extends Timeline {
|
|
|
3372
3395
|
return unselected;
|
|
3373
3396
|
}
|
|
3374
3397
|
|
|
3398
|
+
selectAll( ) {
|
|
3399
|
+
|
|
3400
|
+
this.unSelectAllClips();
|
|
3401
|
+
for(let idx = 0; idx < this.animationClip.tracks.length; idx++) {
|
|
3402
|
+
for(let clipIdx = 0; clipIdx < this.animationClip.tracks[idx].clips.length; clipIdx++) {
|
|
3403
|
+
this.animationClip.tracks[idx].selected[clipIdx] = true;
|
|
3404
|
+
let currentSelection = [ idx, clipIdx];
|
|
3405
|
+
this.lastClipsSelected.push( currentSelection );
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
if(this.onSelectClip)
|
|
3409
|
+
this.onSelectClip();
|
|
3410
|
+
}
|
|
3375
3411
|
processCurrentClip( e, clipIndex, track, localX, multiple ) {
|
|
3376
3412
|
|
|
3377
3413
|
e.multipleSelection = multiple;
|
|
@@ -3632,7 +3668,7 @@ class CurvesTimeline extends Timeline {
|
|
|
3632
3668
|
}
|
|
3633
3669
|
return
|
|
3634
3670
|
|
|
3635
|
-
|
|
3671
|
+
|
|
3636
3672
|
}
|
|
3637
3673
|
|
|
3638
3674
|
const removeHover = () => {
|
|
@@ -3759,7 +3795,7 @@ class CurvesTimeline extends Timeline {
|
|
|
3759
3795
|
// this.canvasArea.root.innerHtml = "";
|
|
3760
3796
|
let offset = this.trackHeight;
|
|
3761
3797
|
this.scrollableHeight = this.topMargin;
|
|
3762
|
-
|
|
3798
|
+
for(let t = 0; t < this.selectedItems.length; t++) {
|
|
3763
3799
|
let tracks = this.tracksPerItem[this.selectedItems[t]] ? this.tracksPerItem[this.selectedItems[t]] : [{name: this.selectedItems[t]}];
|
|
3764
3800
|
if(!tracks) continue;
|
|
3765
3801
|
|
|
@@ -3773,7 +3809,7 @@ class CurvesTimeline extends Timeline {
|
|
|
3773
3809
|
if(track.hide) {
|
|
3774
3810
|
continue;
|
|
3775
3811
|
}
|
|
3776
|
-
|
|
3812
|
+
|
|
3777
3813
|
this.drawTrackWithCurves(ctx, offsetI * height + offset + scroll_y, height, track.name + " (" + track.type + ")", this.animationClip.tracks[track.clipIdx], track);
|
|
3778
3814
|
offsetI++;
|
|
3779
3815
|
}
|
|
@@ -3813,7 +3849,7 @@ class CurvesTimeline extends Timeline {
|
|
|
3813
3849
|
|
|
3814
3850
|
ctx.save();
|
|
3815
3851
|
ctx.translate(keyframePosX, y );
|
|
3816
|
-
|
|
3852
|
+
|
|
3817
3853
|
if( keyframePosX <= this.sidebarWidth ){
|
|
3818
3854
|
ctx.moveTo( 0, value );
|
|
3819
3855
|
}
|
|
@@ -4117,7 +4153,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4117
4153
|
}
|
|
4118
4154
|
|
|
4119
4155
|
|
|
4120
|
-
|
|
4156
|
+
#paste( track, index ) {
|
|
4121
4157
|
|
|
4122
4158
|
let clipboardInfo = this.clipboard.value;
|
|
4123
4159
|
|
|
@@ -4144,7 +4180,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4144
4180
|
this.saveState(track.clipIdx);
|
|
4145
4181
|
|
|
4146
4182
|
// Copy to current key
|
|
4147
|
-
this
|
|
4183
|
+
this.#paste( track, index );
|
|
4148
4184
|
|
|
4149
4185
|
if(!e.multipleSelection)
|
|
4150
4186
|
return;
|
|
@@ -4154,7 +4190,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4154
4190
|
|
|
4155
4191
|
// Copy to every selected key
|
|
4156
4192
|
for(let [name, idx, keyIndex] of this.lastKeyFramesSelected) {
|
|
4157
|
-
this
|
|
4193
|
+
this.#paste( this.tracksPerItem[name][idx], keyIndex );
|
|
4158
4194
|
}
|
|
4159
4195
|
}
|
|
4160
4196
|
|
|
@@ -4163,7 +4199,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4163
4199
|
this.saveState(track.clipIdx);
|
|
4164
4200
|
|
|
4165
4201
|
// Copy to current key
|
|
4166
|
-
this
|
|
4202
|
+
this.#paste( track, index );
|
|
4167
4203
|
|
|
4168
4204
|
if(!e.multipleSelection)
|
|
4169
4205
|
return;
|
|
@@ -4173,7 +4209,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4173
4209
|
|
|
4174
4210
|
// Copy to every selected key
|
|
4175
4211
|
for(let [name, idx, keyIndex] of this.lastKeyFramesSelected) {
|
|
4176
|
-
this
|
|
4212
|
+
this.#paste( this.tracksPerItem[name][idx], keyIndex );
|
|
4177
4213
|
}
|
|
4178
4214
|
}
|
|
4179
4215
|
|
|
@@ -4245,7 +4281,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4245
4281
|
track.hovered[newIdx] = undefined;
|
|
4246
4282
|
track.selected[newIdx] = undefined;
|
|
4247
4283
|
track.edited[newIdx] = true;
|
|
4248
|
-
|
|
4284
|
+
|
|
4249
4285
|
|
|
4250
4286
|
// Update animation action interpolation info
|
|
4251
4287
|
if(this.onUpdateTrack)
|
|
@@ -4267,7 +4303,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4267
4303
|
* @track: track that keyframe belongs to
|
|
4268
4304
|
* @index: index of the keyframe on the track
|
|
4269
4305
|
*/
|
|
4270
|
-
|
|
4306
|
+
#delete( track, index ) {
|
|
4271
4307
|
|
|
4272
4308
|
// Don't remove by now the first key
|
|
4273
4309
|
if(index == 0) {
|
|
@@ -4335,7 +4371,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4335
4371
|
// Delete every selected key
|
|
4336
4372
|
for(let [name, idx, keyIndex] of pts) {
|
|
4337
4373
|
this.saveState(this.tracksPerItem[name][idx].clipIdx);
|
|
4338
|
-
let deleted = this
|
|
4374
|
+
let deleted = this.#delete( this.tracksPerItem[name][idx], keyIndex - deletedIndices );
|
|
4339
4375
|
deletedIndices += deleted ? 1 : 0;
|
|
4340
4376
|
}
|
|
4341
4377
|
}
|
|
@@ -4351,7 +4387,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4351
4387
|
|
|
4352
4388
|
if ( track ){
|
|
4353
4389
|
this.saveState(track.clipIdx);
|
|
4354
|
-
this
|
|
4390
|
+
this.#delete( track, index );
|
|
4355
4391
|
}
|
|
4356
4392
|
}
|
|
4357
4393
|
|
|
@@ -4375,7 +4411,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4375
4411
|
for(let i = count - 1; i >= 0; i--)
|
|
4376
4412
|
{
|
|
4377
4413
|
this.saveState(track.clipIdx);
|
|
4378
|
-
this
|
|
4414
|
+
this.#delete(track, i );
|
|
4379
4415
|
}
|
|
4380
4416
|
if(defaultValue != undefined) {
|
|
4381
4417
|
if(typeof(defaultValue) == 'number') {
|
|
@@ -4523,7 +4559,7 @@ class CurvesTimeline extends Timeline {
|
|
|
4523
4559
|
const name = this.tracksDictionary[track.fullname];
|
|
4524
4560
|
let t = this.tracksPerItem[ name ][track.idx];
|
|
4525
4561
|
let currentSelection = [name, track.idx, keyFrameIndex];
|
|
4526
|
-
|
|
4562
|
+
if(!multiple)
|
|
4527
4563
|
this.selectKeyFrame(t, currentSelection, keyFrameIndex);
|
|
4528
4564
|
else
|
|
4529
4565
|
this.lastKeyFramesSelected.push( currentSelection );
|
|
@@ -4595,7 +4631,7 @@ CanvasRenderingContext2D.prototype.roundRect = function(x, y, width, height, rad
|
|
|
4595
4631
|
this.fill();
|
|
4596
4632
|
}
|
|
4597
4633
|
if (stroke) {
|
|
4598
|
-
|
|
4634
|
+
this.stroke();
|
|
4599
4635
|
}
|
|
4600
4636
|
}
|
|
4601
4637
|
|
package/build/lexgui.css
CHANGED
|
@@ -2862,6 +2862,7 @@ ul.lexassetscontent {
|
|
|
2862
2862
|
margin: 0;
|
|
2863
2863
|
padding: 0;
|
|
2864
2864
|
border-right: none;
|
|
2865
|
+
border-radius: 1px;
|
|
2865
2866
|
position: absolute;
|
|
2866
2867
|
z-index: 0 !important;
|
|
2867
2868
|
left: 0px;
|
|
@@ -2931,17 +2932,28 @@ ul.lexassetscontent {
|
|
|
2931
2932
|
color: #95a0e1;
|
|
2932
2933
|
}
|
|
2933
2934
|
|
|
2934
|
-
.cm-str { color: #
|
|
2935
|
-
.cm-kwd { color: #218cce; } /* keyword */
|
|
2936
|
-
.cm-com { color: #5cab5a; } /* comment */
|
|
2937
|
-
.cm-typ { color: #36c0b0; } /* type */
|
|
2938
|
-
.cm-std { color: #cf6dcf; } /* statements & declarations */
|
|
2939
|
-
.cm-bln { color: inherit; } /* builtin */
|
|
2940
|
-
.cm-dec { color: #b1ce9b; } /* decimal */
|
|
2941
|
-
.cm-sym { color: #e7ded2; } /* symbol */
|
|
2942
|
-
.cm-mtd { color: #e0cc68 } /* method */
|
|
2943
|
-
|
|
2944
|
-
.cm-str.
|
|
2935
|
+
.cm-str.javascript { color: #ca7d59; } /* string */
|
|
2936
|
+
.cm-kwd.javascript { color: #218cce; } /* keyword */
|
|
2937
|
+
.cm-com.javascript { color: #5cab5a; } /* comment */
|
|
2938
|
+
.cm-typ.javascript { color: #36c0b0; } /* type */
|
|
2939
|
+
.cm-std.javascript { color: #cf6dcf; } /* statements & declarations */
|
|
2940
|
+
.cm-bln.javascript { color: inherit; } /* builtin */
|
|
2941
|
+
.cm-dec.javascript { color: #b1ce9b; } /* decimal */
|
|
2942
|
+
.cm-sym.javascript { color: #e7ded2; } /* symbol */
|
|
2943
|
+
.cm-mtd.javascript { color: #e0cc68 } /* method */
|
|
2944
|
+
|
|
2945
|
+
.cm-str.cpp { color: #ca7d59; } /* string */
|
|
2946
|
+
.cm-kwd.cpp { color: #218cce; } /* keyword */
|
|
2947
|
+
.cm-com.cpp { color: #5cab5a; } /* comment */
|
|
2948
|
+
.cm-typ.cpp { color: #36c0b0; } /* type */
|
|
2949
|
+
.cm-std.cpp { color: #cf6dcf; } /* statements & declarations */
|
|
2950
|
+
.cm-bln.cpp { color: #d44141; } /* builtin */
|
|
2951
|
+
.cm-dec.cpp { color: #2ddf53; } /* decimal */
|
|
2952
|
+
.cm-sym.cpp { color: #e7ded2; } /* symbol */
|
|
2953
|
+
.cm-mtd.cpp { color: #7a9ae0 } /* method */
|
|
2954
|
+
.cm-ppc.cpp { color: #969696 } /* preprocessor */
|
|
2955
|
+
|
|
2956
|
+
.cm-str.css { color: #ca7d59; } /* string */
|
|
2945
2957
|
.cm-kwd.css { color: #e8be53; } /* keyword */
|
|
2946
2958
|
.cm-com.css { color: #5cab5a; } /* comment */
|
|
2947
2959
|
.cm-typ.css { color: #b7c3ec; } /* type */
|
|
@@ -2951,7 +2963,7 @@ ul.lexassetscontent {
|
|
|
2951
2963
|
.cm-sym.css { color: #f9d620; } /* symbol */
|
|
2952
2964
|
.cm-mtd.css { color: #e0cc68; } /* method */
|
|
2953
2965
|
|
|
2954
|
-
.cm-str.json { color: #
|
|
2966
|
+
.cm-str.json { color: #ca7d59; } /* string */
|
|
2955
2967
|
.cm-kwd.json { color: inherit; } /* keyword */
|
|
2956
2968
|
.cm-com.json { color: inherit; } /* comment */
|
|
2957
2969
|
.cm-typ.json { color: inherit; } /* type */
|
|
@@ -2961,7 +2973,7 @@ ul.lexassetscontent {
|
|
|
2961
2973
|
.cm-sym.json { color: #cf6dcf; } /* symbol */
|
|
2962
2974
|
.cm-mtd.json { color: inherit; } /* method */
|
|
2963
2975
|
|
|
2964
|
-
.cm-str.glsl { color: #
|
|
2976
|
+
.cm-str.glsl { color: #ca7d59; } /* string */
|
|
2965
2977
|
.cm-kwd.glsl { color: #2194ce; } /* keyword */
|
|
2966
2978
|
.cm-com.glsl { color: #5cab5a; } /* comment */
|
|
2967
2979
|
.cm-typ.glsl { color: #36c0b0; } /* type */
|
|
@@ -2971,7 +2983,7 @@ ul.lexassetscontent {
|
|
|
2971
2983
|
.cm-sym.glsl { color: #f9cb20; } /* symbol */
|
|
2972
2984
|
.cm-mtd.glsl { color: #e0cc68; } /* method */
|
|
2973
2985
|
|
|
2974
|
-
.cm-str.wgsl { color: #
|
|
2986
|
+
.cm-str.wgsl { color: #ca7d59; } /* string */
|
|
2975
2987
|
.cm-kwd.wgsl { color: #2194ce; } /* keyword */
|
|
2976
2988
|
.cm-com.wgsl { color: #5cab5a; } /* comment */
|
|
2977
2989
|
.cm-typ.wgsl { color: #36c0b0; } /* type */
|
|
@@ -2981,6 +2993,26 @@ ul.lexassetscontent {
|
|
|
2981
2993
|
.cm-sym.wgsl { color: #f9cb20; } /* symbol */
|
|
2982
2994
|
.cm-mtd.wgsl { color: #e0cc68; } /* method */
|
|
2983
2995
|
|
|
2996
|
+
.cm-str.python { color: #ca7d59; } /* string */
|
|
2997
|
+
.cm-kwd.python { color: #218cce; } /* keyword */
|
|
2998
|
+
.cm-com.python { color: #5cab5a; } /* comment */
|
|
2999
|
+
.cm-typ.python { color: #36c0b0; } /* type */
|
|
3000
|
+
.cm-std.python { color: #cf6dcf; } /* statements & declarations */
|
|
3001
|
+
.cm-bln.python { color: inherit; } /* builtin */
|
|
3002
|
+
.cm-dec.python { color: #b1ce9b; } /* decimal */
|
|
3003
|
+
.cm-sym.python { color: #e7ded2; } /* symbol */
|
|
3004
|
+
.cm-mtd.python { color: #e0cc68 } /* method */
|
|
3005
|
+
|
|
3006
|
+
.cm-str.batch { color: #ca7d59; } /* string */
|
|
3007
|
+
.cm-kwd.batch { color: #218cce; } /* keyword */
|
|
3008
|
+
.cm-com.batch { color: #5cab5a; } /* comment */
|
|
3009
|
+
.cm-typ.batch { color: #36c0b0; } /* type */
|
|
3010
|
+
.cm-std.batch { color: #cf6dcf; } /* statements & declarations */
|
|
3011
|
+
.cm-bln.batch { color: inherit; } /* builtin */
|
|
3012
|
+
.cm-dec.batch { color: #b1ce9b; } /* decimal */
|
|
3013
|
+
.cm-sym.batch { color: #e6dc20; } /* symbol */
|
|
3014
|
+
.cm-mtd.batch { color: inherit } /* method */
|
|
3015
|
+
|
|
2984
3016
|
/* plain color */
|
|
2985
3017
|
.cm-str.plaintext, .cm-kwd.plaintext, .cm-com.plaintext, .cm-typ.plaintext, .cm-std.plaintext,
|
|
2986
3018
|
.cm-bln.plaintext, .cm-dec.plaintext, .cm-sym.plaintext, .cm-mtd.plaintext { color: inherit; }
|