mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
fixed space clipping
This commit is contained in:
@ -162,69 +162,66 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
||||
panEnabled: true, // Enable panning
|
||||
scaleEnabled: true, // Enable zooming
|
||||
child: Container(
|
||||
width: 2000, // Large canvas
|
||||
height: 2000, // Large canvas
|
||||
color:
|
||||
ColorsManager.transparentColor, // Transparent background
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
// Draw lines using a CustomPaint widget
|
||||
CustomPaint(
|
||||
size: Size(2000, 2000), // Explicit canvas size
|
||||
painter: CurvedLinePainter(connections),
|
||||
),
|
||||
|
||||
spaces.isEmpty
|
||||
? Center(child: AddSpaceButton(
|
||||
color: ColorsManager
|
||||
.transparentColor, // Transparent background
|
||||
child: spaces.isEmpty
|
||||
? Center(
|
||||
child: AddSpaceButton(
|
||||
onTap: () {
|
||||
_showCreateSpaceDialog(screenSize);
|
||||
},
|
||||
))
|
||||
: Stack(
|
||||
children: spaces
|
||||
.asMap()
|
||||
.entries
|
||||
.map((entry) => SpaceCardWidget(
|
||||
index: entry.key,
|
||||
screenSize: screenSize,
|
||||
position: spaces[entry.key].position,
|
||||
isHovered: spaces[entry.key].isHovered,
|
||||
onPanUpdate: (int index, Offset delta) {
|
||||
setState(() {
|
||||
spaces[index].position += delta;
|
||||
});
|
||||
},
|
||||
onHoverChanged:
|
||||
(int index, bool isHovered) {
|
||||
setState(() {
|
||||
spaces[index].isHovered = isHovered;
|
||||
});
|
||||
},
|
||||
onButtonTap: (int index,
|
||||
Offset newPosition,
|
||||
String direction) {
|
||||
_showCreateSpaceDialog(
|
||||
screenSize,
|
||||
position: spaces[index].position +
|
||||
newPosition,
|
||||
parentIndex: index,
|
||||
direction: direction,
|
||||
);
|
||||
},
|
||||
buildSpaceContainer: (int index) {
|
||||
return SpaceContainerWidget(
|
||||
index: index,
|
||||
icon: spaces[index].icon,
|
||||
name: spaces[index].name,
|
||||
);
|
||||
},
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
CustomPaint(
|
||||
size: Size(4000, 4000),
|
||||
painter: CurvedLinePainter(connections),
|
||||
),
|
||||
...spaces.asMap().entries.map((entry) {
|
||||
final space = entry.value;
|
||||
return Positioned(
|
||||
left: space.position.dx,
|
||||
top: space.position.dy,
|
||||
child: SpaceCardWidget(
|
||||
index: entry.key,
|
||||
screenSize: screenSize,
|
||||
position: space.position,
|
||||
isHovered: space.isHovered,
|
||||
onPanUpdate: (int index, Offset delta) {
|
||||
setState(() {
|
||||
spaces[index].position += delta;
|
||||
});
|
||||
},
|
||||
onHoverChanged:
|
||||
(int index, bool isHovered) {
|
||||
setState(() {
|
||||
spaces[index].isHovered = isHovered;
|
||||
});
|
||||
},
|
||||
onButtonTap: (int index, Offset newPosition,
|
||||
String direction) {
|
||||
_showCreateSpaceDialog(
|
||||
screenSize,
|
||||
position: spaces[index].position +
|
||||
newPosition,
|
||||
parentIndex: index,
|
||||
direction: direction,
|
||||
);
|
||||
},
|
||||
buildSpaceContainer: (int index) {
|
||||
return SpaceContainerWidget(
|
||||
index: index,
|
||||
icon: spaces[index].icon,
|
||||
name: spaces[index].name,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user