refactor canvas painter

This commit is contained in:
2025-07-27 01:41:17 +00:00
parent 2366102cce
commit e5f33c6212
7 changed files with 12 additions and 18 deletions
+2 -3
View File
@@ -9,10 +9,9 @@ import 'controller/controller.dart';
/// An infinite canvas that places all the children at the specified positions.
/// Needs a [LazyCanvasController] to control the canvas and a [CanvasBackground] to draw the background.
class LazyCanvas extends StatefulWidget {
final CanvasBackground canvasBackground;
final LazyCanvasController controller;
const LazyCanvas({required this.controller, required this.canvasBackground, super.key});
const LazyCanvas({required this.controller, super.key});
@override
State<LazyCanvas> createState() => _LazyCanvasState();
@@ -47,7 +46,7 @@ class _LazyCanvasState extends State<LazyCanvas> with TickerProviderStateMixin<L
final children = childrenWithPositions.map((e) => e.child).toList();
final canvas = _CanvasRenderObject(
childrenIds: childrenIds,
canvasBackground: widget.canvasBackground,
canvasBackground: widget.controller.background,
ssPositions: ssPositions,
scale: widget.controller.scale,
gridSpaceOffset: widget.controller.offset,