box_transform 0.3.0 copy "box_transform: ^0.3.0" to clipboard
box_transform: ^0.3.0 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
0
points
3.66k
downloads

Publisher

verified publisherhyperdesigned.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

meta, vector_math

More

Packages that depend on box_transform