Skip to content

Commit 868ce0e

Browse files
committed
🔧 Fix initial position of transformable box.
1 parent 2906df7 commit 868ce0e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

example/lib/main.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,10 @@ class _ContentViewState extends State<ContentView> with WidgetsBindingObserver {
265265

266266
SchedulerBinding.instance.addPostFrameCallback((_) {
267267
controller.setClampingRect(getArea(), notify: false);
268-
controller.setRect(Rect.fromLTWH(
269-
controller.clampingRect.left,
270-
controller.clampingRect.top,
271-
min(500, controller.clampingRect.width),
272-
controller.clampingRect.height,
268+
controller.setRect(Rect.fromCenter(
269+
center: controller.clampingRect.center,
270+
width: min(500, controller.clampingRect.width),
271+
height: controller.clampingRect.height,
273272
));
274273
if (mounted) setState(() {});
275274
});

0 commit comments

Comments
 (0)