From e1847f93b7556c19ded0f22299b5221d34ff6bf1 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 17 Nov 2018 00:11:07 +0100 Subject: [PATCH] Fixed video alignment when video is aligned to left or right, not center --- js/modules/Resizer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/modules/Resizer.js b/js/modules/Resizer.js index 992575b..4d32829 100644 --- a/js/modules/Resizer.js +++ b/js/modules/Resizer.js @@ -309,8 +309,10 @@ if(Debug.debug) console.log("[Resizer::_res_computeOffsets] video will be aligned to ", this.settings.active.miscFullscreenSettings.videoFloat); } - var wdiff = this.conf.player.dimensions.width - this.conf.video.offsetWidth; - var hdiff = this.conf.player.dimensions.height - this.conf.video.offsetHeight; + const wdiff = this.conf.player.dimensions.width - this.conf.video.offsetWidth; + const hdiff = this.conf.player.dimensions.height - this.conf.video.offsetHeight; + + const wdiffAfterzoom = this.conf.video.offsetWidth * stretchFactors.xFactor - this.conf.player.dimensions.width; var translate = { x: wdiff * 0.5, @@ -326,10 +328,10 @@ if(Debug.debug) translate.y = hdiff * this.pan.relativeOffsetY / this.zoom.scale; } else { if (this.videoFloat == "left") { - translate.x = 0; + translate.x += wdiffAfterzoom * 0.5; } else if (this.videoFloat == "right") { - translate.x = wdiff; + translate.x -= wdiffAfterzoom * 0.5; } }