--- a/client/js/paper-renderer.js Wed Oct 23 03:09:47 2013 +0200
+++ b/client/js/paper-renderer.js Thu Oct 24 15:29:44 2013 +0200
@@ -1577,6 +1577,7 @@
this.notif_$ = this.$.find(".Rk-Notifications");
paper.setup(this.canvas_$[0]);
this.scale = 1;
+ this.initialScale = 1;
this.offset = paper.view.center;
this.totalScroll = 0;
this.mouse_down = false;
@@ -2160,7 +2161,7 @@
this.redrawUsers();
},
setScale: function(_newScale, _offset) {
- if (_newScale > _MIN_SCALE && _newScale < _MAX_SCALE) {
+ if ((_newScale/this.initialScale) > _MIN_SCALE && (_newScale/this.initialScale) < _MAX_SCALE) {
this.scale = _newScale;
if (_offset) {
this.offset = _offset;
@@ -2177,7 +2178,8 @@
_miny = Math.min.apply(Math, _yy),
_maxx = Math.max.apply(Math, _xx),
_maxy = Math.max.apply(Math, _yy);
- var _scale = Math.max(_MIN_SCALE, Math.min(_MAX_SCALE, (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny)));
+ var _scale = Math.min( (paper.view.size.width - 2 * this.renkan.options.autoscale_padding) / (_maxx - _minx), (paper.view.size.height - 2 * this.renkan.options.autoscale_padding) / (_maxy - _miny));
+ this.initialScale = _scale;
this.setScale(_scale, paper.view.center.subtract(new paper.Point([(_maxx + _minx) / 2, (_maxy + _miny) / 2]).multiply(_scale)));
}
if (nodes.length === 1) {