From 6480bddd4f3bc8e7c1c7f87fcbf27dd79a0b42e1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 29 Oct 2011 08:37:28 +0000 Subject: [PATCH] fix a bug with icon lists that have a fixed ratio smaller than 1 --- source/Ox.UI/js/List/Ox.IconList.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/List/Ox.IconList.js b/source/Ox.UI/js/List/Ox.IconList.js index 55ea2c6b..061a7039 100644 --- a/source/Ox.UI/js/List/Ox.IconList.js +++ b/source/Ox.UI/js/List/Ox.IconList.js @@ -56,10 +56,12 @@ Ox.IconList = function(options, self) { self.options.defaultRatio = self.options.fixedRatio; } - self.iconHeight = Math.round(self.options.size / (self.options.fixedRatio || 1)); self.iconWidth = self.options.size; - self.itemHeight = self.iconHeight + self.options.size * 0.5; + self.iconHeight = self.options.fixedRatio > 1 + ? Math.round(self.options.size / self.options.fixedRatio) + : self.options.size; self.itemWidth = self.options.size; + self.itemHeight = self.iconHeight + self.options.size * 0.5; that.$element = Ox.List({ centered: self.options.centered,