Fix some floating point issues.

This commit is contained in:
Lars Jung 2014-12-12 02:27:55 +01:00
parent c7c080d029
commit 3aead503c1
3 changed files with 10 additions and 10 deletions

View file

@ -6,7 +6,7 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
mov: ['vid-avi', 'vid-flv', 'vid-mkv', 'vid-mov', 'vid-mp4', 'vid-mpg', 'vid-webm'],
doc: ['x-pdf', 'x-ps'],
delay: 1,
size: 128,
size: 100,
exif: true
}, allsettings.thumbnails);
@ -17,7 +17,7 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
action: 'getThumbHref',
type: type,
href: href,
width: settings.size * ratio,
width: Math.round(settings.size * ratio),
height: settings.size
}, function (json) {

View file

@ -3,7 +3,7 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
var modes = ['details', 'grid', 'icons'];
var settings = _.extend({}, {
modes: modes,
sizes: [16, 24, 32, 48, 64, 96, 128, 192, 256]
sizes: [20, 40, 60, 80, 100, 150, 200],
}, allsettings.view);
var storekey = 'viewmode';
var modeTemplate =
@ -46,9 +46,9 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
function applyCssSizes(size) {
var dsize = cropSize(size, 16, 96);
var gsize = cropSize(size, 48, 192);
var isize = cropSize(size, 96);
var dsize = cropSize(size, 10, 80);
var gsize = cropSize(size, 40, 150);
var isize = cropSize(size, 80);
var rules = [
'#view.view-details .item .label { line-height: ' + (dsize+14) + 'px !important; }',
'#view.view-details .item .date { line-height: ' + (dsize+14) + 'px !important; }',
@ -61,9 +61,9 @@ modulejs.define('view/viewmode', ['_', '$', 'core/settings', 'core/resource', 'c
'#view.view-grid .square { width: ' + gsize + 'px !important; }',
'#view.view-grid .square img { width: ' + gsize + 'px !important; height: ' + gsize + 'px !important; }',
'#view.view-icons .item { width: ' + (isize*4/3) + 'px !important; }',
'#view.view-icons .item { width: ' + Math.round(isize*4/3) + 'px !important; }',
'#view.view-icons .landscape img { width: ' + isize + 'px !important; height: ' + isize + 'px !important; }',
'#view.view-icons .landscape .thumb { width: ' + (isize*4/3) + 'px !important; }'
'#view.view-icons .landscape .thumb { width: ' + Math.round(isize*4/3) + 'px !important; }'
];
applyCss(rules);
}

View file

@ -38,7 +38,7 @@ Options
"hideParentFolder": true,
"modes": ["details", "grid", "icons"],
"setParentFolderLabels": true,
"sizes": [16, 24, 32, 48, 64, 96, 128, 192, 256],
"sizes": [20, 40, 60, 80, 100, 150, 200, 250, 300, 350, 400],
"smartBrowsing": true,
"theme": "",
"unmanaged": ["index.html", "index.htm", "index.php"],
@ -310,7 +310,7 @@ Options
"mov": ["vid-avi", "vid-flv", "vid-mkv", "vid-mov", "vid-mp4", "vid-mpg", "vid-webm"],
"doc": ["x-pdf", "x-ps"],
"delay": 1,
"size": 96,
"size": 100,
"exif": true
},