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 7946829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:15:34+00:00 2026-06-04T01:15:34+00:00

I am rotating an NSView using: setFrameRotation: Which rotates the view around its bottom

  • 0

I am rotating an NSView using:

 setFrameRotation:

Which rotates the view around its bottom left corner. What is the best way to rotate a view around its center point?

Also, i want to get the points in the superview of its corners. Using:

view.frame.origin

Just gives me the corner before i rotate it. How would i get the actual points of its corners once it has been rotated?

Thanks in advance, Ben

  • 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-04T01:15:35+00:00Added an answer on June 4, 2026 at 1:15 am

    To get an effective rotation about the center of the frame, you have to translate the frame’s origin.

    Also, of course view.frame.origin gives the origin before you rotate it. It’s also giving you the origin after you rotate it, because the rotation is around the origin. The origin isn’t moving. If you do translate the origin to get rotation around the center, you’ll then know the new origin.

    To get the other corners, you’d use [view convertPoint:pt toView:view.superview], where pt is each of the corners in the view’s coordinate system. E.g. NSMakePoint(NSMaxX([view bounds]), NSMinY([view bounds])).

    You can actually use this technique to obtain the translation you want. Compute the desired center of the view, or just record the current center if it’s where you want it. Then rotate the view. Obtain the new location of the center using -convertPoint:toView:. Then translate the origin by the difference between the new center and the desired center.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a flash rotating banner in my website which takes images and descriptions
I am rotating the view and resizing and moving around UITextFields when this occurs.
I have a rotating div that contains a number of divs around its edge.
I created a rotating cube using the below code and add bitmaps as sides
I'm trying to simulate rotating box using Newton Physics and OpenGL. This is what
I have this method for rotating points in 3D using quaternions, but it seems
I have a problem with rotating. I know that I can rotate a Texture2D
When rotating a View from UIInterfaceOrientationPortrait to UIInterfaceOrientationPortraitUpsideDown on the iPad simulator, there is
I am rotating points around a center point in 2D space. The points are
Has anyone successfully hidden a UITabbar when rotating the device? I have one view

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.