Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Objective-C/TOCropViewController/TOCropViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,12 @@ - (void)viewSafeAreaInsetsDidChange {
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];

[UIView performWithoutAnimation:^{
self.toolbar.frame = [self frameForToolbarWithVerticalLayout:self.verticalLayout];
[self adjustToolbarInsets];
[self.toolbar setNeedsLayout];
}];

self.cropView.frame = [self frameForCropViewWithVerticalLayout:self.verticalLayout];
[self adjustCropViewInsets];
[self.cropView moveCroppedContentToCenterAnimated:NO];
Expand All @@ -502,12 +508,6 @@ - (void)viewDidLayoutSubviews {
self.titleLabel.frame = [self frameForTitleLabelWithSize:self.titleLabel.frame.size verticalLayout:self.verticalLayout];
[self.cropView moveCroppedContentToCenterAnimated:NO];
}

[UIView performWithoutAnimation:^{
self.toolbar.frame = [self frameForToolbarWithVerticalLayout:self.verticalLayout];
[self adjustToolbarInsets];
[self.toolbar setNeedsLayout];
}];
}

#pragma mark - Rotation Handling -
Expand Down
4 changes: 2 additions & 2 deletions Objective-C/TOCropViewController/Views/TOCropView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1709,8 +1709,8 @@ - (CGRect)contentBounds {
CGRect contentRect = CGRectZero;
contentRect.origin.x = self.cropViewPadding + self.cropRegionInsets.left;
contentRect.origin.y = self.cropViewPadding + self.cropRegionInsets.top;
contentRect.size.width = CGRectGetWidth(self.bounds) - ((self.cropViewPadding * 2) + self.cropRegionInsets.left + self.cropRegionInsets.right);
contentRect.size.height = CGRectGetHeight(self.bounds) - ((self.cropViewPadding * 2) + self.cropRegionInsets.top + self.cropRegionInsets.bottom);
contentRect.size.width = CGRectGetWidth(self.frame) - ((self.cropViewPadding * 2) + self.cropRegionInsets.left + self.cropRegionInsets.right);
contentRect.size.height = CGRectGetHeight(self.frame) - ((self.cropViewPadding * 2) + self.cropRegionInsets.top + self.cropRegionInsets.bottom);
return contentRect;
}

Expand Down