Skip to content

Commit e678e7e

Browse files
Oofkymartin-henz
andauthored
Fixed liveness bug for null array units (#3642)
* Fixed null array units liveness Fixed the issue where null array units sometimes still have the default stroke color, despite being dead * Fixed format errors --------- Co-authored-by: Martin Henz <henz@comp.nus.edu.sg>
1 parent d331a5d commit e678e7e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/features/cseMachine/components/ArrayNullUnit.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ export class ArrayNullUnit extends Visible {
2121
// needs to be recalculated here unlike arrayunit, as primitive value treat it as a text
2222
this._x = this.reference.x();
2323
this._y = this.reference.y();
24+
const strokeColor =
25+
this.reference.parent.isReferenced() && this.reference.parent.isEnclosingFrameLive()
26+
? defaultStrokeColor()
27+
: fadedStrokeColor();
28+
2429
return (
2530
<KonvaLine
2631
{...ShapeDefaultProps}
2732
key={Layout.key++}
2833
points={[this.x(), this.y() + this.height(), this.x() + this.width(), this.y()]}
29-
stroke={this.reference.parent.isReferenced() ? defaultStrokeColor() : fadedStrokeColor()}
34+
stroke={strokeColor}
3035
hitStrokeWidth={Config.DataHitStrokeWidth}
3136
ref={this.ref}
3237
listening={false}

0 commit comments

Comments
 (0)