From dde00ed000aae83ad97ca3b6069fe4d352d6cac9 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Tue, 19 Feb 2013 08:56:32 -0500 Subject: [PATCH] Small fixes for trackster resolution calculation. --- static/scripts/viz/trackster/tracks.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/static/scripts/viz/trackster/tracks.js b/static/scripts/viz/trackster/tracks.js index 3f1c174633a..58b72b87e4f 100644 --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -1427,11 +1427,12 @@ extend( TracksterView.prototype, DrawableCollection.prototype, { // -- Drawing code -- - // Calculate resolution in both pixels/base and bases/pixel; round bases/pixels for tile calculations. - // TODO: require minimum difference in new resolution to update? + // Calculate resolution in both pixels/base and bases/pixel. + // TODO: require minimum difference in new resolution to update? This + // would help alleviate issues when window is being resized. this.resolution_b_px = (this.high - this.low) / this.viewport_container.width(); - this.resolution_px_b = this.viewport_container.width() / (this.high - this.low); - + this.resolution_px_b = 1 / this.resolution_b_px; + // Overview var left_px = ( this.low / (this.max_high - this.max_low) * this.overview_viewport.width() ) || 0; var width_px = ( (this.high - this.low)/(this.max_high - this.max_low) * this.overview_viewport.width() ) || 0;