Alexandre's fit-to-width height scaling fix

This commit is contained in:
Pedro Beschorner Marin 2017-04-11 20:50:53 +00:00
parent 086ea510c4
commit c45e14e185

View File

@ -862,13 +862,14 @@ function processSlideAspectTimes() {
}
function processAspectValue(vboxWidth, vboxHeight, time, lastAspectValue) {
var imageId;
if (time == "0.0") {
//a little hack 'cause function getImageAtTime with time = 0.0 returns the background image...
//we need the first slide instead
var imageId = "image1";
imageId = "image1";
}
else {
var imageId = getImageAtTime(time);
imageId = getImageAtTime(time);
}
if (imageId !== undefined) {
@ -961,8 +962,10 @@ window.onresize = function(event) {
var resizeSlides = function() {
if (currentImage) {
var $slide = $("#slide");
var max = currentSlideAspect * $slide.parent().outerHeight();
$slide.css("max-width", max);
var maxWidth = currentSlideAspect * $slide.parent().outerHeight();
$slide.css("max-width", maxWidth);
var maxHeight = $slide.parent().width() / currentSlideAspect;
$slide.css("max-height", maxHeight);
}
};