• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange stretching NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange stretching NSView


  • Subject: Re: Strange stretching NSView
  • From: Ken Tozier <email@hidden>
  • Date: Thu, 1 Feb 2007 18:26:38 -0500


On Feb 1, 2007, at 5:35 PM, Murat Konar wrote:

On Feb 1, 2007, at 2:16 PM, Ken Tozier wrote:

The really bizarre thing is that the smaller I set the view height, the bigger the vertical stretch gets even though the containing frame size stays exactly the same. It's some stupid math error I'm sure.

You aren't confusing the effects of -[NSView setBounds:] and - [NSView setFrame:] somewhere are you?


For example, start with a view whose frame is {100, 100, 100, 100}. By default, its bounds will be {0, 0, 100, 100}. If you then set the bounds of this view to {0, 0, 100, 50}, the views contents will appear distorted in the vertical dimension because you are effectively applying a coordinate transformation.

From the documentation on setBounds:

"After calling [setBounds:], NSView creates an internal transform (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed."

Bingo! I was indeed confusing the two. All better now.

Thanks Murat.

Ken
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Strange stretching NSView (From: Gonzalo Castro <email@hidden>)
 >Re: Strange stretching NSView (From: Ken Tozier <email@hidden>)
 >Re: Strange stretching NSView (From: Murat Konar <email@hidden>)

  • Prev by Date: Re: what is error -7000 when activating fonts?
  • Next by Date: Printing from an NSSplitView
  • Previous by thread: Re: Strange stretching NSView
  • Next by thread: CoreData - Turning to-many relationship back into a fault
  • Index(es):
    • Date
    • Thread