zoom level fixed

This commit is contained in:
Peter Cottle 2013-01-05 15:07:09 -08:00
parent 953bd49ee2
commit ebdf188c1d
3 changed files with 35 additions and 2 deletions

View file

@ -14890,14 +14890,25 @@ function detectZoom() {
return window.outerWidth / window.innerWidth; return window.outerWidth / window.innerWidth;
} }
var locked = true;
var setupZoomPoll = function(callback, context) { var setupZoomPoll = function(callback, context) {
var currentZoom = 0; var currentZoom = 0;
setInterval(function() { setInterval(function() {
var newZoom = detectZoom(); var newZoom = detectZoom();
if (newZoom !== currentZoom) { if (newZoom !== currentZoom) {
// we need to wait one more before issuing callback
// to avoid window resize issues
if (locked) {
locked = false;
return;
}
currentZoom = newZoom; currentZoom = newZoom;
callback.apply(context, [newZoom]); callback.apply(context, [newZoom]);
} else {
locked = true;
} }
}, 500); }, 500);
}; };
@ -19162,14 +19173,25 @@ function detectZoom() {
return window.outerWidth / window.innerWidth; return window.outerWidth / window.innerWidth;
} }
var locked = true;
var setupZoomPoll = function(callback, context) { var setupZoomPoll = function(callback, context) {
var currentZoom = 0; var currentZoom = 0;
setInterval(function() { setInterval(function() {
var newZoom = detectZoom(); var newZoom = detectZoom();
if (newZoom !== currentZoom) { if (newZoom !== currentZoom) {
// we need to wait one more before issuing callback
// to avoid window resize issues
if (locked) {
locked = false;
return;
}
currentZoom = newZoom; currentZoom = newZoom;
callback.apply(context, [newZoom]); callback.apply(context, [newZoom]);
} else {
locked = true;
} }
}, 500); }, 500);
}; };

View file

@ -21,14 +21,25 @@ function detectZoom() {
return window.outerWidth / window.innerWidth; return window.outerWidth / window.innerWidth;
} }
var locked = true;
var setupZoomPoll = function(callback, context) { var setupZoomPoll = function(callback, context) {
var currentZoom = 0; var currentZoom = 0;
setInterval(function() { setInterval(function() {
var newZoom = detectZoom(); var newZoom = detectZoom();
if (newZoom !== currentZoom) { if (newZoom !== currentZoom) {
// we need to wait one more before issuing callback
// to avoid window resize issues
if (locked) {
locked = false;
return;
}
currentZoom = newZoom; currentZoom = newZoom;
callback.apply(context, [newZoom]); callback.apply(context, [newZoom]);
} else {
locked = true;
} }
}, 500); }, 500);
}; };

View file

@ -4,7 +4,6 @@ Big things:
Big Graphic things: Big Graphic things:
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
[ ] levels dropdown selection? [ ] levels dropdown selection?
[.] level teardown
[ ] git demonstration view [ ] git demonstration view
[ ] sandbox can launch and takedown levels [ ] sandbox can launch and takedown levels
@ -22,7 +21,6 @@ Minor Bugs to fix:
Big Bugs to fix: Big Bugs to fix:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ ] window zoom alert thing -- this just needs to be timeouted one more time
[ ] click handlers on goal visualization for the actual canvas elements [ ] click handlers on goal visualization for the actual canvas elements
/************************************* /*************************************
@ -34,6 +32,8 @@ Big Bugs to fix:
Done things: Done things:
(I only started this on Dec 17th 2012 to get a better sense of what was done) (I only started this on Dec 17th 2012 to get a better sense of what was done)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[x] window zoom alert thing -- this just needs to be timeouted one more time
[x] level teardown
[x] great die for levels [x] great die for levels
[x] show which level you are in! with a little thing on the top [x] show which level you are in! with a little thing on the top
[x] allow command history to clear finished ones [x] allow command history to clear finished ones