box_transform 0.4.1 copy "box_transform: ^0.4.1" to clipboard
box_transform: ^0.4.1 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
18
likes
130
pub points
52%
popularity

Publisher

verified publisherhyperdesigned.dev

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

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

Apache-2.0 (LICENSE)

Dependencies

meta, vector_math

More

Packages that depend on box_transform