--- a/client/js/paper-renderer.js Mon Feb 17 17:39:52 2014 +0100
+++ b/client/js/paper-renderer.js Mon Feb 17 17:58:39 2014 +0100
@@ -1794,12 +1794,14 @@
bindClick(".Rk-ZoomIn", "zoomIn");
bindClick(".Rk-ZoomFit", "autoScale");
this.$.find(".Rk-ZoomSave").click( function() {
- console.log("SAVE ZOOM FOR REAL", _this, _this.scale);
- _this.renkan.project.set("zoom_level", _this.scale); // Save scale
+ console.log("SAVE ZOOM FOR REAL", _this.scale, _this.offset);
+ console.log("_this.renkan.project", _this.renkan.project);
+ _this.renkan.project.set("views", [{id:Rkns.Utils.getUID('view'), zoom_level:_this.scale, offset_x:_this.offset.x, offset_y:_this.offset.y}]); // Save scale
_this.$.find(".Rk-ZoomSetSaved").show();
});
this.$.find(".Rk-ZoomSetSaved").click( function() {
- _this.setScale(_this.renkan.project.get("zoom_level"));
+ var view = _this.renkan.project.get("views")[0];
+ _this.setScale(view.zoom_level, new paper.Point(view.offset_x, view.offset_y));
});
this.$.find(".Rk-CurrentUser").mouseenter(
function() { _this.$.find(".Rk-UserList").slideDown(); }
@@ -2686,7 +2688,6 @@
this.canvas_$.width(),
this.canvas_$.height()
]).multiply( .5 * ( 1 - Math.SQRT1_2 ) ).add(this.offset.multiply( Math.SQRT1_2 ));
- this.$.find(".Rk-ZoomSlider").slider('value', this.$.find(".Rk-ZoomSlider").slider("option", "value") - 1);
this.setScale( _newScale, _offset );
},
zoomIn: function() {
@@ -2695,7 +2696,6 @@
this.canvas_$.width(),
this.canvas_$.height()
]).multiply( .5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
- this.$.find(".Rk-ZoomSlider").slider('value', this.$.find(".Rk-ZoomSlider").slider("option", "value") + 1);
this.setScale( _newScale, _offset );
},
addNodeBtn: function() {