Index: remoting/webapp/me2mom/client_session.js |
diff --git a/remoting/webapp/me2mom/client_session.js b/remoting/webapp/me2mom/client_session.js |
index 021f14fa5a59a0ea0e775cd55204def8f5eee5ba..d697019ea2d8dc175231c517735eb56cbb29106d 100644 |
--- a/remoting/webapp/me2mom/client_session.js |
+++ b/remoting/webapp/me2mom/client_session.js |
@@ -367,8 +367,6 @@ remoting.ClientSession.prototype.onDesktopSizeChanged_ = function() { |
*/ |
remoting.ClientSession.prototype.toggleScaleToFit = function(shouldScale) { |
if (shouldScale) { |
- remoting.debug.log('scale to fit is turned on.'); |
- |
if (this.plugin.desktopWidth == 0 || |
this.plugin.desktopHeight == 0) { |
remoting.debug.log('desktop size is not known yet.'); |
@@ -383,27 +381,24 @@ remoting.ClientSession.prototype.toggleScaleToFit = function(shouldScale) { |
if (height % 2 == 1) |
--height; |
- var scale = 1.0; |
- if (width < height) |
- scale = 1.0 * height / this.plugin.desktopHeight; |
- else |
- scale = 1.0 * width / this.plugin.desktopWidth; |
- |
+ var scaleFitHeight = 1.0 * height / this.plugin.desktopHeight; |
+ var scaleFitWidth = 1.0 * width / this.plugin.desktopWidth; |
Jamie
2011/08/13 02:24:51
I'd be tempted to guard against either width or he
Lambros
2011/08/15 20:03:45
Already covered by line 370, I think?
|
+ var scale = Math.min(scaleFitHeight, scaleFitWidth); |
if (scale > 1.0) { |
remoting.debug.log('scale up is not supported'); |
- return; |
+ scale = 1.0; |
} |
this.plugin.width = this.plugin.desktopWidth * scale; |
this.plugin.height = this.plugin.desktopHeight * scale; |
} else { |
- remoting.debug.log('scale to fit is turned off.'); |
this.plugin.width = this.plugin.desktopWidth; |
this.plugin.height = this.plugin.desktopHeight; |
} |
remoting.debug.log('plugin size is now: ' + |
this.plugin.width + ' x ' + this.plugin.height + '.'); |
this.plugin.setScaleToFit(shouldScale); |
+ remoting.debug.log('scale to fit is now: ' + shouldScale); |
}; |
/** |