On 13 May 2006, at 01:25, Christian Miller wrote:

ratio = double
w = the window with the player on it
mPlayer = the player

            ratio = w.mPlayer.Width / w.mPlayer.Height

            if w.mPlayer.width > w.mPlayer.height then
              w.mPlayer.Width = w.Width
              w.mPlayer.Height = w.mPlayer.Height * (ratio + 1)

            else
              w.mPlayer.Height = w.Height
              w.mPlayer.Width = w.mPlayer.Width * (ratio + 1)

            end if

Replace w.mPlayer.Width etc with numerical representations and you'll see where you're going wrong:

ratio = 4 / 3
// which is 1.33

if 4 > 3 then
  Width = 6 // new width, for example
  Height = 3 * (1.33 + 1)
     // you have not referenced the new Width in this
     // line, and you've changed the ratio by adding 1
     // so the height will only ever be multiplied by
     // 2.33 no matter what the width is
else
  //
end if

I hope that helps you work it out.

All the best,

Mark.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to