@@ -194,27 +194,27 @@ class _DrawingBoardState extends State<DrawingBoard> {
194
194
195
195
/// 构建画板
196
196
Widget get _buildBoard {
197
- return RepaintBoundary (
198
- key: _controller.painterKey,
199
- child: ExValueBuilder <DrawConfig >(
200
- valueListenable: _controller.drawConfig,
201
- shouldRebuild: (DrawConfig p, DrawConfig n) =>
202
- p.angle != n.angle || p.size != n.size,
203
- builder: (_, DrawConfig dc, Widget ? child) {
204
- Widget c = child! ;
205
-
206
- if (dc.size != null ) {
207
- final bool isHorizontal = dc.angle.toDouble () % 2 == 0 ;
208
- final double max = dc.size! .longestSide;
209
-
210
- if (! isHorizontal) {
211
- c = SizedBox (width: max, height: max, child: c);
212
- }
197
+ return ExValueBuilder <DrawConfig >(
198
+ valueListenable: _controller.drawConfig,
199
+ shouldRebuild: (DrawConfig p, DrawConfig n) =>
200
+ p.angle != n.angle || p.size != n.size,
201
+ builder: (_, DrawConfig dc, Widget ? child) {
202
+ Widget c = child! ;
203
+
204
+ if (dc.size != null ) {
205
+ final bool isHorizontal = dc.angle.toDouble () % 2 == 0 ;
206
+ final double max = dc.size! .longestSide;
207
+
208
+ if (! isHorizontal) {
209
+ c = SizedBox (width: max, height: max, child: c);
213
210
}
211
+ }
214
212
215
- return Transform .rotate (angle: dc.angle * pi / 2 , child: c);
216
- },
217
- child: Center (
213
+ return Transform .rotate (angle: dc.angle * pi / 2 , child: c);
214
+ },
215
+ child: Center (
216
+ child: RepaintBoundary (
217
+ key: _controller.painterKey,
218
218
child: Stack (
219
219
alignment: Alignment .center,
220
220
children: < Widget > [_buildImage, _buildPainter],
0 commit comments