From 3aead503c14ead995033c515ab1c6dec7f8efe2b Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 12 Dec 2014 02:27:55 +0100 Subject: [PATCH] Fix some floating point issues. --- src/_h5ai/client/js/inc/ext/thumbnails.js | 4 ++-- src/_h5ai/client/js/inc/view/viewmode.js | 12 ++++++------ src/_h5ai/conf/options.json | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/_h5ai/client/js/inc/ext/thumbnails.js b/src/_h5ai/client/js/inc/ext/thumbnails.js index ed0bd584..5e6dd2bf 100644 --- a/src/_h5ai/client/js/inc/ext/thumbnails.js +++ b/src/_h5ai/client/js/inc/ext/thumbnails.js @@ -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) { diff --git a/src/_h5ai/client/js/inc/view/viewmode.js b/src/_h5ai/client/js/inc/view/viewmode.js index 89126f52..6d8b5bff 100644 --- a/src/_h5ai/client/js/inc/view/viewmode.js +++ b/src/_h5ai/client/js/inc/view/viewmode.js @@ -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); } diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index bd5341b6..05f5e788 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -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 },