Advertisement
nicklovell123

Untitled

Feb 17th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. // if viewframe left and top coordinates are non zero value then exclude it
  3. // during the computation of xRatio and yRatio
  4. xRatio = (inPos.x - viewFrame.left)/actualWidth;
  5. yRatio = (inPos.y - viewFrame.top)/actualHeight;
  6. // Use viewframe width and height to compute wRatio and hRatio.
  7. wRatio = (float)inPos.w/(float)(viewFrame.right - viewFrame.left);
  8. hRatio = (float)inPos.h/(float)(viewFrame.bottom - viewFrame.top);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement