diff --git a/src/com/android/alarmclock/WidgetUtils.java b/src/com/android/alarmclock/WidgetUtils.java
index d4a6b70..ad1bd63 100644
--- a/src/com/android/alarmclock/WidgetUtils.java
+++ b/src/com/android/alarmclock/WidgetUtils.java
@@ -44,12 +44,14 @@
             options = widgetManager.getAppWidgetOptions(id);
         }
         if (options != null) {
-            int minWidth = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH);
+            float minWidth = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH);
             if (minWidth == 0) {
                 // No data , do no scaling
                 return 1f;
             }
             Resources res = context.getResources();
+            float density = res.getDisplayMetrics().density;
+            minWidth *= density;
             float ratio = minWidth / res.getDimension(R.dimen.def_digital_widget_width);
             return (ratio > 1) ? 1 : ratio;
         }
@@ -84,9 +86,11 @@
             // no data to make the calculation, show the list anyway
             return true;
         }
-        int minHeight = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT);
-        int neededSize = (int) context.getResources().
-            getDimension(R.dimen.digital_widget_list_min_height);
+        float minHeight = options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT);
+        Resources res = context.getResources();
+        float density = res.getDisplayMetrics().density;
+        minHeight *= density;
+        int neededSize = (int) res.getDimension(R.dimen.digital_widget_list_min_height);
         return (minHeight > neededSize);
     }
 }
