Skip to content

Commit 017bcea

Browse files
authored
Update ArrayAccessAnimation.tsx
1 parent 7413d87 commit 017bcea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/features/cseMachine/animationComponents/ArrayAccessAnimation.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class ArrayAccessAnimation extends Animatable {
2828
private resultAnimation: AnimatedTextbox;
2929
private resultArrowAnimation?: AnimatedGenericArrow<StashItemComponent, Visible>;
3030
private arrayUnit: ArrayUnit;
31-
private out: boolean;
31+
private outOfRange: boolean;
3232

3333
constructor(
3434
private accInstr: ControlItemComponent,
@@ -48,15 +48,15 @@ export class ArrayAccessAnimation extends Animatable {
4848
});
4949
this.arrayArrowAnimation = new AnimatedGenericArrow(arrayItem.arrow!);
5050
// if index is out of range
51-
this.out = false;
51+
this.outOfRange = false;
5252
// the target should always be an array value
5353
const array = arrayItem.arrow!.target! as ArrayValue;
5454

5555
// if index access is out of range. if index access is negative, error should be thrown from js-slang at this point
5656
const arraylen = array.data.length;
5757

5858
if (parseInt(indexItem.text) >= arraylen) {
59-
this.out = true;
59+
this.outOfRange = true;
6060
this.arrayUnit = array.units[arraylen - 1];
6161
} else {
6262
this.arrayUnit = array.units[parseInt(indexItem.text)];
@@ -69,7 +69,7 @@ export class ArrayAccessAnimation extends Animatable {
6969
this.arrayUnit.x() +
7070
this.arrayUnit.width() / 2 -
7171
this.resultItem.width() / 2 +
72-
(this.out ? this.arrayUnit.width() : 0),
72+
(this.outOfRange ? this.arrayUnit.width() : 0),
7373
y: this.arrayUnit.y() + this.arrayUnit.height() / 2 - this.resultItem.height() / 2,
7474
opacity: 0
7575
});
@@ -102,7 +102,7 @@ export class ArrayAccessAnimation extends Animatable {
102102
this.arrayUnit.x() +
103103
this.arrayUnit.width() / 2 -
104104
this.indexItem.width() / 2 +
105-
(this.out ? this.arrayUnit.width() : 0),
105+
(this.outOfRange ? this.arrayUnit.width() : 0),
106106
y: this.arrayUnit.y() - this.indexItem.height() - 8
107107
};
108108
const indexInArrayLocation = {

0 commit comments

Comments
 (0)