You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/10/14 17:09:19 UTC

cordova-plugin-camera git commit: change 'case' to else-if. This closes #113

Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master b8a68af63 -> a030c52f7


change 'case' to else-if. This closes #113


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/a030c52f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/a030c52f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/a030c52f

Branch: refs/heads/master
Commit: a030c52f7f0d3c71cfd42a56b03b349cf5840eef
Parents: b8a68af
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Aug 4 12:04:17 2015 -0700
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Wed Oct 14 18:08:01 2015 +0300

----------------------------------------------------------------------
 src/windows/CameraProxy.js | 33 +++++++++++++--------------------
 1 file changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/a030c52f/src/windows/CameraProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CameraProxy.js b/src/windows/CameraProxy.js
index 505d3d8..64b6bb7 100644
--- a/src/windows/CameraProxy.js
+++ b/src/windows/CameraProxy.js
@@ -20,7 +20,7 @@
 */
 
 /*jshint unused:true, undef:true, browser:true */
-/*global Windows:true, URL:true, module:true, require:true */
+/*global Windows:true, URL:true, module:true, require:true, WinJS:true */
 
 
 var Camera = require('./Camera');
@@ -701,25 +701,18 @@ function takePictureFromCameraWindows(successCallback, errorCallback, args) {
     var UIMaxRes = WMCapture.CameraCaptureUIMaxPhotoResolution;
     var totalPixels = targetWidth * targetHeight;
 
-    switch (true) {
-        case (totalPixels <= 320 * 240):
-            maxRes = UIMaxRes.verySmallQvga;
-            break;
-        case (totalPixels <= 640 * 480):
-            maxRes = UIMaxRes.smallVga;
-            break;
-        case (totalPixels <= 1024 * 768):
-            maxRes = UIMaxRes.mediumXga;
-            break;
-        case (totalPixels <= 3 * 1000 * 1000):
-            maxRes = UIMaxRes.large3M;
-            break;
-        case (totalPixels <= 5 * 1000 * 1000):
-            maxRes = UIMaxRes.veryLarge5M;
-            break;
-        default:
-            maxRes = UIMaxRes.highestAvailable;
-            break;
+    if (totalPixels <= 320 * 240) {
+        maxRes = UIMaxRes.verySmallQvga;
+    } else if (totalPixels <= 640 * 480) {
+        maxRes = UIMaxRes.smallVga;
+    } else if (totalPixels <= 1024 * 768) {
+        maxRes = UIMaxRes.mediumXga;
+    } else if (totalPixels <= 3 * 1000 * 1000) {
+        maxRes = UIMaxRes.large3M;
+    } else if (totalPixels <= 5 * 1000 * 1000) {
+        maxRes = UIMaxRes.veryLarge5M;
+    } else {
+        maxRes = UIMaxRes.highestAvailable;
     }
 
     cameraCaptureUI.photoSettings.maxResolution = maxRes;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org