client/js/renderer/viewrepr.js
changeset 557 18c36f038e9f
parent 554 32c7378d1c28
child 560 05a4380227f3
equal deleted inserted replaced
556:2737bc21e6dd 557:18c36f038e9f
   159                                        this.renderer.canvas_$.width(),
   159                                        this.renderer.canvas_$.width(),
   160                                        this.renderer.canvas_$.height()
   160                                        this.renderer.canvas_$.height()
   161                                        ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
   161                                        ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
   162             this.setScale( _newScale, _offset );
   162             this.setScale( _newScale, _offset );
   163         },
   163         },
   164         resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {
   164         resizeZoom: function(deltaW, deltaH, _ratio) {
   165             var _newScale = this.scale * _ratio,
   165             var _newScale = this.scale * _ratio;
   166                 _offset = new paper.Point([
   166             var _offset = new paper.Point([
   167                                        (this.offset.x * _scaleWidth),
   167                                        (this.renderer.canvas_$.width() * 0.5 * ( 1 - _ratio) ) + (this.offset.x * _ratio + deltaW * _ratio * 0.5 ),
   168                                        (this.offset.y * _scaleHeight)
   168                                        (this.renderer.canvas_$.height() * 0.5 * ( 1 - _ratio) ) + (this.offset.y * _ratio + deltaH * _ratio * 0.5 )
   169                                        ]);
   169                                        ]);
   170             this.setScale( _newScale, _offset );
   170             this.setScale( _newScale, _offset );
   171         },
   171         },
   172         autoScale: function(force_view) {
   172         autoScale: function(force_view) {
   173             var nodes = this.renkan.project.get("nodes");
   173             var nodes = this.renkan.project.get("nodes");