Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some CropView bottom is hided if TOCropViewController is not full height #367

Open
dobiho5 opened this issue Aug 21, 2019 · 1 comment
Open
Assignees

Comments

@dobiho5
Copy link

dobiho5 commented Aug 21, 2019

Describe the bug

Some CropView Bottom is hided when CropViewController is not full height.


// View has another toolbar below TOCropViewController
TOCropViewController *cropController;

self.cropController = =  [[TOCropViewController alloc] initWithCroppingStyle:self.croppingStyle image:self.image];

self.cropController.view.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.toolBar.frame.origin.y);

[self addChildViewController:self.cropController];
    [self.view addSubview:self.cropController.view];
    [self.cropController didMoveToParentViewController:self];
    [self.view bringSubviewToFront:self.toolBar];

I can fixed it in TOCropViewController.m with +100

- (CGRect)frameForCropViewWithVerticalLayout:(BOOL)verticalLayout
{
if (!verticalLayout) {
        frame.origin.x = kTOCropViewControllerToolbarHeight + insets.left;
        frame.size.width = CGRectGetWidth(bounds) - frame.origin.x;
		frame.size.height = CGRectGetHeight(bounds);
    }
    else { // Vertical layout
        frame.size.height = CGRectGetHeight(bounds);
        frame.size.width = CGRectGetWidth(bounds);

        // Set Y and adjust for height
        if (self.toolbarPosition == TOCropViewControllerToolbarPositionBottom) {
           // +100
            frame.size.height -= (insets.bottom + kTOCropViewControllerToolbarHeight + 100);
        } else if (self.toolbarPosition == TOCropViewControllerToolbarPositionTop) {
			frame.origin.y = kTOCropViewControllerToolbarHeight + insets.top;
            frame.size.height -= frame.origin.y;
        }
    }
}

If TOCropViewController frame is changed, would you change bottom height?

@TimOliver
Copy link
Owner

Thanks for the report @dobiho5.

Um. The library has full support for arbitrary frame sizes. How exactly are you presenting it? Can you attach a screenshot?

Simply adding 100 points is a very naive way of fixing it and might create more bugs than it fixes. 😅

@TimOliver TimOliver added the rfc label Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants