Advertisement
cornedor

Untitled

May 21st, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. artEditor.prototype.fxSetFinalSize = function(size) {
  2.     var w1 = this.canvas.width,
  3.         h1 = this.canvas.height,
  4.         w2 = size.split('x')[this.editor.setViewPosition],
  5.             h2 = size.split('x')[1 - this.editor.setViewPosition],
  6.         a1 = h2 / w2 * w1,
  7.         a2 = w2 / h2 * h1,
  8.         os = 25;
  9.  
  10.     if((w2 / h2) > (w1 / h1)) {
  11.         this.setFinalView[0] = os;
  12.         this.setFinalView[1] = (h1 * 0.5) - (a1 / 2) + (os * (h2 / w2));
  13.     } else {
  14.         this.setFinalView[0] = (w1 * 0.5) - (a2 / 2) + (os * (w2 / h2));
  15.         this.setFinalView[1] = os;
  16.     }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement