[Pkg-owncloud-commits] [owncloud] 399/457: floats are not welcome when setting the size of a preview

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 7b84343cfc998e1e110965079fbe9581423125dd
Author: Olivier Paroz <github at oparoz.com>
Date:   Fri Jun 12 18:56:18 2015 +0200

    floats  are not welcome when setting the size of a preview
---
 apps/files_sharing/js/public.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 32a4694..5923e42 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -89,8 +89,8 @@ OCA.Sharing.PublicApp = {
 		// dynamically load image previews
 		var token = $('#sharingToken').val();
 		var bottomMargin = 350;
-		var previewWidth = $(window).width() * window.devicePixelRatio;
-		var previewHeight = ($(window).height() - bottomMargin) * window.devicePixelRatio;
+		var previewWidth = Math.floor($(window).width() * window.devicePixelRatio);
+		var previewHeight = Math.floor(($(window).height() - bottomMargin) * window.devicePixelRatio);
 		previewHeight = Math.max(200, previewHeight);
 		var params = {
 			x: previewWidth,
@@ -159,8 +159,8 @@ OCA.Sharing.PublicApp = {
 
 			this.fileList.generatePreviewUrl = function (urlSpec) {
 				urlSpec.t = $('#dirToken').val();
-				urlSpec.y = 36 * window.devicePixelRatio;
-				urlSpec.x = 36 * window.devicePixelRatio;
+				urlSpec.y = Math.floor(36 * window.devicePixelRatio);
+				urlSpec.x = Math.floor(36 * window.devicePixelRatio);
 				return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec);
 			};
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list