Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: remoting/webapp/me2mom/client_session.js

Issue 7633045: Fix scaling calculation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1166e75730ac9afb92490f49c14bc686288ab197 100644
--- a/remoting/webapp/me2mom/client_session.js
+++ b/remoting/webapp/me2mom/client_session.js
@@ -383,12 +383,9 @@ 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;
+ var scale = Math.min(scaleFitHeight, scaleFitWidth);
if (scale > 1.0) {
remoting.debug.log('scale up is not supported');
Wez 2011/08/13 01:38:51 Don't we need to be sure to re-set things to 1:1 h
Lambros 2011/08/13 02:13:30 Done.
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698