11import 'dart:convert' ;
22import 'dart:math' ;
3+ import 'package:cookethflow/core/theme/colors.dart' ;
34import 'package:cookethflow/core/utils/enums.dart' ;
45import 'package:cookethflow/features/models/canvas_models/canvas_object.dart' ;
56import 'package:cookethflow/features/models/canvas_models/objects/circle_object.dart' ;
@@ -25,6 +26,7 @@ class CanvasPainter extends CustomPainter {
2526 final String ? currentlySelectedObjectId;
2627 final double handleRadius;
2728 final InteractionMode interactionMode;
29+ final Color workspaceColor; // NEW: Added workspace color
2830
2931 // NEW: Connector-related properties
3032 final double connectionPointRadius;
@@ -38,6 +40,8 @@ class CanvasPainter extends CustomPainter {
3840 this .currentlySelectedObjectId,
3941 this .handleRadius = 8.0 ,
4042 required this .interactionMode,
43+ // NEW: Initialize workspace color
44+ required this .workspaceColor,
4145 // NEW: Initialize connector properties
4246 this .connectionPointRadius = 6.0 ,
4347 this .connectorSourceId,
@@ -253,12 +257,12 @@ class CanvasPainter extends CustomPainter {
253257 canvas.drawOval (topEllipseRect, fillPaint);
254258 canvas.drawOval (bottomEllipseRect, fillPaint);
255259
256- // Draw the white line for the top of the cylinder
257- final whitePaint = Paint ()
258- ..color = Colors .white
260+ // Use the workspaceColor for the "hollow" border
261+ final borderPaint = Paint ()
262+ ..color = workspaceColor
259263 ..style = PaintingStyle .stroke
260264 ..strokeWidth = 2.0 ;
261- canvas.drawOval (topEllipseRect, whitePaint );
265+ canvas.drawOval (topEllipseRect, borderPaint );
262266 }
263267 }
264268
@@ -452,6 +456,7 @@ class CanvasPainter extends CustomPainter {
452456 oldPainter.canvasObjects.length != canvasObjects.length ||
453457 oldPainter.currentlySelectedObjectId != currentlySelectedObjectId ||
454458 oldPainter.interactionMode != interactionMode ||
459+ oldPainter.workspaceColor != workspaceColor || // NEW: Added color check
455460 _hasCanvasObjectsChanged (oldPainter.canvasObjects, canvasObjects) ||
456461 oldPainter.connectorDragPosition !=
457462 connectorDragPosition; // Add check for connector drag
0 commit comments