fix a bug with icon lists that have a fixed ratio smaller than 1

This commit is contained in:
rlx 2011-10-29 08:37:28 +00:00
parent 039a65e251
commit 6480bddd4f

View file

@ -56,10 +56,12 @@ Ox.IconList = function(options, self) {
self.options.defaultRatio = self.options.fixedRatio; self.options.defaultRatio = self.options.fixedRatio;
} }
self.iconHeight = Math.round(self.options.size / (self.options.fixedRatio || 1));
self.iconWidth = self.options.size; 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.itemWidth = self.options.size;
self.itemHeight = self.iconHeight + self.options.size * 0.5;
that.$element = Ox.List({ that.$element = Ox.List({
centered: self.options.centered, centered: self.options.centered,