File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
packages/box_transform/example Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ ## Resizing a Box
3
+
4
+ ``` dart
5
+ final Box rect = Box.fromLTWH(50, 50, 100, 100);
6
+
7
+ final ResizeResult result = BoxTransformer.resize(
8
+ handle: HandlePosition.bottomRight, // handle that is being dragged
9
+ initialRect: rect,
10
+ initialLocalPosition: Vector2.zero(),
11
+ localPosition: Vector2.zero(),
12
+ resizeMode: ResizeMode.freeform,
13
+ initialFlip: Flip.none,
14
+ );
15
+
16
+ result.rect; // the new rect
17
+ ```
18
+
19
+ ## Moving a box.
20
+
21
+ ``` dart title="Moving a box"
22
+ final Box rect = Box.fromLTWH(50, 50, 100, 100);
23
+ final MoveResult result = BoxTransformer.move(
24
+ initialRect: rect,
25
+ initialLocalPosition: Vector2.zero(),
26
+ localPosition: Vector2.zero(),
27
+ );
28
+
29
+ result.position; // the new position of the box
30
+ ```
You can’t perform that action at this time.
0 commit comments