|
1 |
| -import 'dart:developer'; |
2 | 1 | import 'dart:math' hide log;
|
3 | 2 |
|
4 | 3 | import 'package:vector_math/vector_math.dart';
|
@@ -219,11 +218,10 @@ class BoxTransformer {
|
219 | 218 | BindingStrategy bindingStrategy = BindingStrategy.boundingBox,
|
220 | 219 | }) {
|
221 | 220 | if (handle == HandlePosition.none) {
|
222 |
| - log('Using bottomRight handle instead of none.'); |
223 | 221 | handle = HandlePosition.bottomRight;
|
224 | 222 | }
|
225 | 223 |
|
226 |
| - final initialBoundingRect = calculateBoundingRect( |
| 224 | + final Box initialBoundingRect = calculateBoundingRect( |
227 | 225 | rotation: rotation,
|
228 | 226 | unrotatedBox: initialRect,
|
229 | 227 | );
|
@@ -567,72 +565,4 @@ class BoxTransformer {
|
567 | 565 |
|
568 | 566 | return explodedRect;
|
569 | 567 | }
|
570 |
| - |
571 |
| - static Constraints calculateBoundingConstraints( |
572 |
| - {required double rotation, required Constraints constraints}) { |
573 |
| - final double sinA = sin(rotation); |
574 |
| - final double cosA = cos(rotation); |
575 |
| - |
576 |
| - final double maxWidth = constraints.maxWidth; |
577 |
| - final double maxHeight = constraints.maxHeight; |
578 |
| - final double minWidth = constraints.minWidth; |
579 |
| - final double minHeight = constraints.minHeight; |
580 |
| - |
581 |
| - final double maxBoundingWidth = !maxWidth.isFinite |
582 |
| - ? double.infinity |
583 |
| - : (maxWidth * cosA).abs() + (maxHeight * sinA).abs(); |
584 |
| - final double maxBoundingHeight = !maxHeight.isFinite |
585 |
| - ? double.infinity |
586 |
| - : (maxWidth * sinA).abs() + (maxHeight * cosA).abs(); |
587 |
| - final double minBoundingWidth = !minWidth.isFinite |
588 |
| - ? double.infinity |
589 |
| - : (minWidth * cosA).abs() + (minHeight * sinA).abs(); |
590 |
| - final double minBoundingHeight = !minHeight.isFinite |
591 |
| - ? double.infinity |
592 |
| - : (minWidth * sinA).abs() + (minHeight * cosA).abs(); |
593 |
| - |
594 |
| - return Constraints( |
595 |
| - minWidth: minBoundingWidth, |
596 |
| - minHeight: minBoundingHeight, |
597 |
| - maxWidth: maxBoundingWidth, |
598 |
| - maxHeight: maxBoundingHeight, |
599 |
| - ); |
600 |
| - } |
601 |
| - |
602 |
| -// static Dimension calculateBoundingSize({ |
603 |
| -// required double rotation, |
604 |
| -// required Dimension unrotatedSize, |
605 |
| -// }) { |
606 |
| -// final double sinA = sin(rotation); |
607 |
| -// final double cosA = cos(rotation); |
608 |
| -// |
609 |
| -// final double width = unrotatedSize.width; |
610 |
| -// final double height = unrotatedSize.height; |
611 |
| -// final double boundingWidth = (width * cosA).abs() + (height * sinA).abs(); |
612 |
| -// final double boundingHeight = (width * sinA).abs() + (height * cosA).abs(); |
613 |
| -// |
614 |
| -// return Dimension(boundingWidth, boundingHeight); |
615 |
| -// } |
616 |
| - |
617 |
| -// static Box calculateUnrotatedRect({ |
618 |
| -// required Box boundingBox, |
619 |
| -// required double rotation, |
620 |
| -// required double aspectRatio, |
621 |
| -// }) { |
622 |
| -// final Vector2 center = boundingBox.center; |
623 |
| -// |
624 |
| -// final double width = boundingBox.width * cos(-rotation) + |
625 |
| -// boundingBox.height * sin(-rotation); |
626 |
| -// |
627 |
| -// // derive from aspect ratio. |
628 |
| -// final double height = width / aspectRatio; |
629 |
| -// |
630 |
| -// final Box unrotatedRect = Box.fromCenter( |
631 |
| -// center: center, |
632 |
| -// width: width, |
633 |
| -// height: height, |
634 |
| -// ); |
635 |
| -// |
636 |
| -// return unrotatedRect; |
637 |
| -// } |
638 | 568 | }
|
0 commit comments