Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:44:20+00:00 2026-06-01T21:44:20+00:00

This method gets called after i resize a photo: – (void)correctSize:(UIView*)view{ //check if the

  • 0

This method gets called after i resize a photo:

- (void)correctSize:(UIView*)view{
    //check if the newWidth is rounded by 50
    CGFloat correctWidth = roundf(_lastScale*_lastWidth/XPCollageGridHorizontalStepSize) * XPCollageGridHorizontalStepSize;
    CGFloat correctHeight = roundf(_lastScale*_lastHeight/XPCollageGridVerticalStepSize) * XPCollageGridVerticalStepSize;

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5f]; 
    [view setBounds:CGRectMake(view.bounds.origin.x, view.bounds.origin.y, correctWidth, correctHeight)];
    //[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, correctWidth, correctHeight)];
    [UIView commitAnimations];
}

It rounds the photo size; a width of 66 will be rounded to 50, 178 to 200 etc.
It works fine when i use the setFrame method, but because im also working with rotation i want to work with setBounds.

When i use setBounds, the view will resize, but instead of resizing to a rounded number like 300, it resized to something random as 311.23.

Am i missing something here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:44:21+00:00Added an answer on June 1, 2026 at 9:44 pm

    The answer is that i have to use the

    [view setTransform:CGAffineTransformIdentity];
    

    Now its using the already ‘used’ matrix and multiplies it with that.

        CGFloat correctWidth = roundf(_lastScale*_lastWidth/XPCollageGridHorizontalStepSize) * XPCollageGridHorizontalStepSize;
    CGFloat correctHeight = roundf(_lastScale*_lastHeight/XPCollageGridVerticalStepSize) * XPCollageGridVerticalStepSize;
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5f]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    [view setTransform:CGAffineTransformIdentity]; //!!this line is added!
    [view setBounds:CGRectMake(0, 0, correctWidth, correctHeight)];
    
    [UIView commitAnimations];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method which gets called from a different class: -(void)artworkInfo:(NSNumber *)pos{ [image
Whenever the user scrolls map or zooms in/out, this method gets called instantaneously. I
I'm trying to understand why the NotifyComplete() method gets called even after the 25
Hi I have this simple method which gets triggered when i click inside a
With this method declaration (no overloads): void Method(double d) { // do something with
What I have is something similar to this: //method being called by thread pool
If CodeIgniter has _remap() that gets called before it touches any method in a
This method works as expected - it creates a JTree with a root node
This method that draws my tiles seems to be quite slow, Im not sure
This method is working totally right in matlab. but, when I compiled it in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.