Skip to content

Commit 0316f11

Browse files
committed
remove use of thisLayer
1 parent f2d5053 commit 0316f11

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/index.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class Comp {
186186
layer(name: string): Layer;
187187
layer(otherLayer: Layer, relativeIndex: number): Layer;
188188
layer(indexOrOtherLayer: number | string | Layer, relativeIndex?: number) {
189-
return thisLayer;
189+
return new Layer();
190190
}
191191
}
192192

@@ -350,7 +350,7 @@ export class Property<PropertyValueType extends Value> {
350350
amp: number,
351351
octaves: number = 1,
352352
amp_mult: number = 0.5,
353-
time: number = thisLayer.time
353+
time: number = new Layer().time
354354
): PropertyValueType {
355355
const som = freq + amp + octaves + amp_mult + time;
356356
return this.value;
@@ -368,7 +368,7 @@ export class Property<PropertyValueType extends Value> {
368368
amp: number,
369369
octaves: number = 1,
370370
amp_mult: number = 0.5,
371-
time: number = thisLayer.time
371+
time: number = new Layer().time
372372
): PropertyValueType {
373373
return this.value;
374374
}
@@ -380,7 +380,7 @@ export class Property<PropertyValueType extends Value> {
380380
smooth(
381381
width: number = 0.2,
382382
samples: number = 5,
383-
time: number = thisLayer.time
383+
time: number = new Layer().time
384384
): PropertyValueType {
385385
return this.value;
386386
}
@@ -422,7 +422,7 @@ export class PathProperty extends Property<PathValue> {
422422
* Retrieves the points array for a path
423423
* @param time The time at which to sample the path
424424
*/
425-
points(time: number = thisLayer.time): Points {
425+
points(time: number = new Layer().time): Points {
426426
return [
427427
[0, 0],
428428
[0, 0],
@@ -461,7 +461,7 @@ export class PathProperty extends Property<PathValue> {
461461
*/
462462
pointOnPath(
463463
percentage: number = 0.5,
464-
time: number = thisLayer.time
464+
time: number = new Layer().time
465465
): Vector2D {
466466
return [0, 0];
467467
}
@@ -732,7 +732,7 @@ export class SourceText extends Property<string> {
732732
* @param characterIndex Which character to get the style at
733733
* @param sampleTime The time to get the style at, defaulting to the current time
734734
*/
735-
getStyleAt(characterIndex: number, sampleTime: number = thisLayer.time) {
735+
getStyleAt(characterIndex: number, sampleTime: number = new Layer().time) {
736736
return this.style;
737737
}
738738
/**
@@ -1479,8 +1479,6 @@ export class Layer {
14791479
}
14801480
}
14811481

1482-
const thisLayer = new Layer();
1483-
14841482
export class Footage {
14851483
/**
14861484
* The name of the footage item as shown in the project panel

0 commit comments

Comments
 (0)