set limits on scaling

This commit is contained in:
Connor Turland 2013-01-05 23:03:05 -05:00
parent 34ffc8c6b6
commit 30f84d4f09
4 changed files with 32 additions and 4 deletions

View file

@ -2591,7 +2591,22 @@ Extras.Classes.Navigation = new Class({
$.event.stop($.event.get(e, win));
var val = this.config.zooming / 1000,
ans = 1 + scroll * val;
this.canvas.scale(ans, ans);
if (ans > 1) {
if (5 >= this.canvas.scaleOffsetX) {
this.canvas.scale(ans, ans);
}
}
else if (ans < 1) {
if (this.canvas.scaleOffsetX >= 0.2) {
this.canvas.scale(ans, ans);
}
}
if (this.canvas.scaleOffsetX < 0.5) {
this.canvas.viz.labels.hideLabels(true);
}
else if (this.canvas.scaleOffsetX > 0.5) {
this.canvas.viz.labels.hideLabels(false);
}
},
onMouseDown: function(e, win, eventInfo) {

View file

@ -158,6 +158,18 @@ function addMetacode() {
}
}
function MconsoleReset() {
var tX = Mconsole.canvas.translateOffsetX;
var tY = Mconsole.canvas.translateOffsetY;
Mconsole.canvas.translate(-tX,-tY);
var mX = Mconsole.canvas.scaleOffsetX;
var mY = Mconsole.canvas.scaleOffsetY;
Mconsole.canvas.scale((1/mX),(1/mY));
}

View file

@ -84,6 +84,6 @@ var tempForT, tempForS, tempForM;
Mconsole.fx.animate({
modes: ['linear','node-property:dim','edge-property:lineWidth'],
transition: $jit.Trans.Quad.easeInOut,
duration: 3000
duration: 500
});
<% end %>

View file

@ -1,2 +1,3 @@
$('.focusleft').append('<div id="saveNotify">Saved!</div>');
$('#saveNotify').delay(1500).fadeOut('fast', function(){$('#saveNotify').remove()});
$('.saveNotify').remove();
$('.focusleft').append('<div class="saveNotify">Saved!</div>');
$('.saveNotify').delay(1500).fadeOut('fast', function(){$('.saveNotify').remove()});