Re: NSWindow - how to resize it keeping aspect ratio?
Re: NSWindow - how to resize it keeping aspect ratio?
- Subject: Re: NSWindow - how to resize it keeping aspect ratio?
- From: "Alexander Bokovikov" <email@hidden>
- Date: Thu, 25 Feb 2010 20:37:17 +0500
On Thursday, February 25, 2010 at 5:57 PM Ariel Feinerman wrote:
You calculate view`s aspect from it size, but I mean content frame (not
window frame) from constant aspect, for example 4/3, then set size.
I don't understand what is the problem. Isn't "my" 422/674 ratio not a
constant? What is a principal difference between it and "yours" 4/3? Just
substitute my digits to whatever you need. You'll get just the same result.
This constant, used in the message, will keep the aspect ratio. Now you can
(if you wish to) set an initial width of the window (e.g. in the
awakeFromNib), and window height will be adjusted respectively. You don't
need to store both width and height in the preferences. Just save width.
Height will be adjusted automatically. At least it works for me.
Thanks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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