box_transform 0.4.4 copy "box_transform: ^0.4.4" to clipboard
box_transform: ^0.4.4 copied to clipboard

A pure dart implementation of advanced 2D box transformation with easy and simple API.

example/example.md

Resizing a Box #

final Box rect = Box.fromLTWH(50, 50, 100, 100);
  
  final ResizeResult result = BoxTransformer.resize(
    handle: HandlePosition.bottomRight, // handle that is being dragged
    initialRect: rect,
    initialLocalPosition: Vector2.zero(),
    localPosition: Vector2.zero(),
    resizeMode: ResizeMode.freeform,
    initialFlip: Flip.none,
  );
  
  result.rect; // the new rect

Moving a box. #

  final Box rect = Box.fromLTWH(50, 50, 100, 100);
  final MoveResult result = BoxTransformer.move(
    initialRect: rect,
    initialLocalPosition: Vector2.zero(),
    localPosition: Vector2.zero(),
  );
  
  result.position; // the new position of the box
22
likes
160
pub points
61%
popularity

Publisher

verified publisherhyperdesigned.dev

A pure dart implementation of advanced 2D box transformation with easy and simple API.

Repository (GitHub)
View/report issues
Contributing

Topics

#rectangle #box #transform #utility #tool

Documentation

Documentation
API reference

License

Apache-2.0 (license)

Dependencies

vector_math

More

Packages that depend on box_transform