Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. int x1 = a.x(), y1 = a.y(),
  2. x2 = x1 + a.width(), y2 = y1 + a.height();
  3.  
  4. long double dx = (right - left) * 1.0 / this->width(),
  5. dy = (top - bottom) * 1.0 / this->height();
  6.  
  7. long double xr1 = left + x1 * dx, yr1 = bottom + y1 * dy,
  8. xr2 = left + x2 * dx, yr2 = bottom + y2 * dy;
  9.  
  10. left = xr1, right = xr2, bottom = yr1, top = yr2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement