tried out zoom level, shows 2 for some reason

This commit is contained in:
Peter Cottle 2013-01-01 20:15:50 -08:00
parent 6e61ffda59
commit f60b97307a
7 changed files with 3152 additions and 2877 deletions

View file

@ -10,6 +10,11 @@ var GLOBAL = {
isAnimating: false
};
var VIEWPORT = {
minZoom: 1,
maxZoom: 1.15
};
var GRAPHICS = {
arrowHeadSize: 8,
@ -43,4 +48,5 @@ var GRAPHICS = {
exports.GLOBAL = GLOBAL;
exports.TIME = TIME;
exports.GRAPHICS = GRAPHICS;
exports.VIEWPORT = VIEWPORT;

View file

@ -5,7 +5,6 @@ exports.isBrowser = function() {
return inBrowser;
};
exports.splitTextCommand = function(value, func, context) {
func = _.bind(func, context);
_.each(value.split(';'), function(command, index) {

16
src/js/util/zoomLevel.js Normal file
View file

@ -0,0 +1,16 @@
var _ = require('underscore');
var setupZoomPoll = function(callback, context) {
var currentZoom = 0;
setInterval(function() {
var newZoom = window.outerWidth / window.innerWidth;
if (newZoom !== currentZoom) {
currentZoom = newZoom;
callback.apply(context, [newZoom]);
}
}, 100);
};
exports.setupZoomPoll = setupZoomPoll;