mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
applied opacity to connections
This commit is contained in:
@ -127,7 +127,12 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
child: Stack(
|
||||
children: [
|
||||
for (var connection in connections)
|
||||
CustomPaint(painter: CurvedLinePainter([connection])),
|
||||
Opacity(
|
||||
opacity: _isHighlightedConnection(connection)
|
||||
? 1.0
|
||||
: 0.3, // Adjust opacity
|
||||
child: CustomPaint(painter: CurvedLinePainter([connection])),
|
||||
),
|
||||
for (var entry in visibleSpaces.asMap().entries)
|
||||
Positioned(
|
||||
left: entry.value.position.dx,
|
||||
@ -601,4 +606,11 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool _isHighlightedConnection(Connection connection) {
|
||||
if (widget.selectedSpace == null) return true;
|
||||
|
||||
return connection.startSpace == widget.selectedSpace ||
|
||||
connection.endSpace == widget.selectedSpace;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user