@@ -494,11 +494,7 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
494
494
495
495
// The _boundaryRect is calculated by adding the boundaryMargin to the size of
496
496
// the child.
497
- Rect _boundaryRectCached;
498
497
Rect get _boundaryRect {
499
- if (_boundaryRectCached != null ) {
500
- return _boundaryRectCached;
501
- }
502
498
assert (_childKey.currentContext != null );
503
499
assert (! widget.boundaryMargin.left.isNaN);
504
500
assert (! widget.boundaryMargin.right.isNaN);
@@ -507,15 +503,15 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
507
503
508
504
final RenderBox childRenderBox = _childKey.currentContext.findRenderObject () as RenderBox ;
509
505
final Size childSize = childRenderBox.size;
510
- _boundaryRectCached = widget.boundaryMargin.inflateRect (Offset .zero & childSize);
506
+ final Rect boundaryRect = widget.boundaryMargin.inflateRect (Offset .zero & childSize);
511
507
// Boundaries that are partially infinite are not allowed because Matrix4's
512
508
// rotation and translation methods don't handle infinites well.
513
- assert (_boundaryRectCached .isFinite ||
514
- (_boundaryRectCached .left.isInfinite
515
- && _boundaryRectCached .top.isInfinite
516
- && _boundaryRectCached .right.isInfinite
517
- && _boundaryRectCached .bottom.isInfinite), 'boundaryRect must either be infinite in all directions or finite in all directions.' );
518
- return _boundaryRectCached ;
509
+ assert (boundaryRect .isFinite ||
510
+ (boundaryRect .left.isInfinite
511
+ && boundaryRect .top.isInfinite
512
+ && boundaryRect .right.isInfinite
513
+ && boundaryRect .bottom.isInfinite), 'boundaryRect must either be infinite in all directions or finite in all directions.' );
514
+ return boundaryRect ;
519
515
}
520
516
521
517
// The Rect representing the child's parent.
@@ -917,10 +913,6 @@ class _InteractiveViewerState extends State<InteractiveViewer> with TickerProvid
917
913
@override
918
914
void didUpdateWidget (InteractiveViewer oldWidget) {
919
915
super .didUpdateWidget (oldWidget);
920
- if (widget.child != oldWidget.child || widget.boundaryMargin != oldWidget.boundaryMargin) {
921
- _boundaryRectCached = null ;
922
- }
923
-
924
916
// Handle all cases of needing to dispose and initialize
925
917
// transformationControllers.
926
918
if (oldWidget.transformationController == null ) {
0 commit comments