Re: Window/View Size Constraining
Re: Window/View Size Constraining
- Subject: Re: Window/View Size Constraining
- From: Gordon Apple <email@hidden>
- Date: Tue, 23 Oct 2007 13:16:33 -0500
In case anybody is interested, I eventually solved both issues. After I
found out that "setBoundsSize" also sets the scaling, the scaling works
right.
The window/view tracking issue was solved after I figured out that
"windowDidResize" gets called after each movement, not at the end as I
erroneously surmised. I let the "windowWillResize" constrain the window
size during tracking, then recomputed window/view sizes in
"windowDidResize". Now, it all works correctly.
> I totally rewrote the "windowWillResize" delegate method to correctly
> compute size by contentRect rather than frameRect. It works correctly except
> for the same remaining two issues.
>
>> The following code is my attempt to constrain a displayView and window
>> size such that the displayView maintains the proper aspect ratio when the
>> window is resized. I have two issues:
>>
>> 1. The displayView size tracking lags by at
>> least one time sample and I then have to gently nudge the window size to get
>> it right, or at least within one pixel. I don't understand why the display
>> view lags, since I'm computing everything based on the proposed window size,
>> not current size. I could try to clean it up in "windowDidResize", but could
>> end up in an infinite loop trying to do that.
>>
>> 2. This is a variable size window that is intended to show a miniature
>> display of what is in the main window (elsewhere), with a fixed height
>> controlView below.. I made an abortive
>> attempt to scale the coordinates of displayView. Apparently, I don't
>> understand the "scaleUnitSquareToSize" call and the docs don't help much.
>> Any
>> suggestions?
>
_______________________________________________
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