[longomatch] Fix images scalling



commit aac1a7b2fadf6deedb9ac85108bfe5d3f0b90876
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed May 28 16:10:01 2014 +0200

    Fix images scalling

 LongoMatch.Core/Common/Image.cs |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.Core/Common/Image.cs b/LongoMatch.Core/Common/Image.cs
index 658a87f..09352a0 100644
--- a/LongoMatch.Core/Common/Image.cs
+++ b/LongoMatch.Core/Common/Image.cs
@@ -175,15 +175,13 @@ namespace LongoMatch.Common
                        outWidth = maxOutWidth;
                        outHeight = maxOutHeight;
 
-                       if(inWidth > maxOutWidth || inHeight > maxOutHeight) {
-                               double par = (double)inWidth /(double)inHeight;
-                               double outPar = (double)maxOutWidth /(double)maxOutHeight;
+                       double par = (double)inWidth /(double)inHeight;
+                       double outPar = (double)maxOutWidth /(double)maxOutHeight;
                                
-                               if (outPar > par) {
-                                       outWidth = Math.Min (maxOutWidth, (int)(outHeight * par));
-                               } else {
-                                       outHeight = Math.Min (maxOutHeight, (int)(outWidth / par));
-                               }
+                       if (outPar > par) {
+                               outWidth = Math.Min (maxOutWidth, (int)(outHeight * par));
+                       } else {
+                               outHeight = Math.Min (maxOutHeight, (int)(outWidth / par));
                        }
                } 
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]