From: Stephen Cameron Date: Fri, 30 Jun 2017 09:36:43 +0000 (+0200) Subject: Fix #1469 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=08751d98bf97051d9302177cf85fca45929ff23f;p=fluidbook-html5.git Fix #1469 @0.75 --- diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index b7173e8f..a7dbfc82 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -381,7 +381,18 @@ FluidbookVideo.prototype = { if (videojs(id) && videojs(id).isFullscreen()) { $(this).attr('style', ''); // Clear scaling for fullscreen player } else { - $(this).css('fontSize', 12 / fluidbook.resize.bookScale); + var scaledFontSize = 12 / fluidbook.resize.bookScale, + scaledWidth = $(this).width() * fluidbook.resize.bookScale, // Actual screen width in pixels + breakpoint = 400; // Width of player when it should start scaling down all elements as width reduces + + // Sometimes the player might be very small so we need to + // scale the font size differently in this case to make it fit + if (scaledWidth < breakpoint) { + $(this).css('fontSize', scaledFontSize * scaledWidth / breakpoint); + } else { + $(this).css('fontSize', scaledFontSize); + } + } }); },