Posted By

KalKut on 08/20/14


Tagged


Versions (?)

Zoom


 / Published in: JavaScript
 

Zoom method

  1. zoom : function (factor) {// Merci Geo !
  2. this.imgRect = this.imgRect.move({staticPoint : this.staticPoint, scale : factor});
  3.  
  4. if ( !(this.potentialRect.segX.c2 >= parseInt(this.div.style.width) && this.potentialRect.segX.c1 <= 0 && this.potentialRect.segY.c1 <= 0 && this.potentialRect.segY.c2 >= parseInt(this.div.style.height) ) ) {
  5. this.imgRect = this.imgRect.forcedIn(new r.Geo.Rect({ p1 : [0,0], p2 : [parseInt(this.div.style.width),parseInt(this.div.style.height)]}))
  6. }
  7.  
  8. this.img.style.width = this.imgRect.segX.getLength();
  9. this.img.style.height = this.imgRect.segY.getLength();
  10. this.img.style.left = this.imgRect.segX.c1;
  11. this.img.style.top = this.imgRect.segY.c1;
  12. }

Report this snippet  

You need to login to post a comment.