diff -r c8eaff36abc7 -r 96781c1a8bbe client/js/renderer/scene.js --- a/client/js/renderer/scene.js Fri Mar 13 16:46:50 2015 +0100 +++ b/client/js/renderer/scene.js Tue Mar 17 18:53:36 2015 +0100 @@ -30,9 +30,6 @@ this.delete_list = []; this.redrawActive = true; - var currentWidth = this.canvas_$.width(); - var currentHeight = this.canvas_$.height(); - if (_renkan.options.show_minimap) { this.minimap = { background_layer: new paper.Layer(), @@ -60,7 +57,7 @@ this.minimap.miniframe.fillColor = '#c0c0ff'; this.minimap.miniframe.opacity = 0.3; this.minimap.miniframe.strokeColor = '#000080'; - this.minimap.miniframe.strokeWidth = 3; + this.minimap.miniframe.strokeWidth = 2; this.minimap.miniframe.__representation = new MiniFrame(this, null); } @@ -280,13 +277,8 @@ paper.view.onResize = function(_event) { var _ratio, - newWidth= _this.canvas_$.parent().width(), - newHeight = _this.canvas_$.parent().height(); - // Because of paper bug which does not calculate the good height and width - // We have to update manually the canvas's height and width - - paper.view._viewSize.height = _event.size.height = _this.canvas_$.parent().height(); - paper.view._viewSize.width = _event.size.height = _this.canvas_$.parent().width(); + newWidth = _event.width, + newHeight = _event.height; if (_this.minimap) { _this.minimap.topleft = paper.view.bounds.bottomRight.subtract(_this.minimap.size); @@ -294,16 +286,15 @@ _this.minimap.cliprectangle.fitBounds(_this.minimap.topleft, _this.minimap.size); } + var ratioH = newHeight/(newHeight-_event.delta.height), + ratioW = newWidth/(newWidth-_event.delta.width); if (newHeight < newWidth) { - _ratio = (newHeight/currentHeight); + _ratio = ratioH; } else { - _ratio = (newWidth/currentWidth); + _ratio = ratioW; } - _this.resizeZoom((newWidth/currentWidth), (newHeight/currentHeight), _ratio); - - currentWidth = newWidth; - currentHeight = newHeight; + _this.resizeZoom(ratioW, ratioH, _ratio); _this.redraw(); @@ -522,7 +513,7 @@ 'if (options.show_search_field) { %>' + '
<% } %><% } %>' + '