Fixed video alignment
This commit is contained in:
parent
df79c9ddd3
commit
c6e3689d0d
@ -309,13 +309,13 @@ if(Debug.debug)
|
|||||||
console.log("[Resizer::_res_computeOffsets] <rid:"+this.resizerId+"> video will be aligned to ", this.settings.active.miscFullscreenSettings.videoFloat);
|
console.log("[Resizer::_res_computeOffsets] <rid:"+this.resizerId+"> video will be aligned to ", this.settings.active.miscFullscreenSettings.videoFloat);
|
||||||
}
|
}
|
||||||
|
|
||||||
var actualWidth = this.conf.video.offsetWidth * stretchFactors.xFactor;
|
var wdiff = this.conf.player.dimensions.width - this.conf.video.offsetWidth;
|
||||||
var actualHeight = this.conf.video.offsetHeight * stretchFactors.yFactor;
|
var hdiff = this.conf.player.dimensions.height - this.conf.video.offsetHeight;
|
||||||
|
|
||||||
var wdiff = actualWidth - this.conf.player.dimensions.width;
|
var translate = {
|
||||||
var hdiff = actualHeight - this.conf.player.dimensions.height;
|
x: wdiff * 0.5,
|
||||||
|
y: hdiff * 0.5,
|
||||||
var translate = {x: 0, y: 0};
|
};
|
||||||
|
|
||||||
if (this.pan) {
|
if (this.pan) {
|
||||||
// don't offset when video is smaller than player
|
// don't offset when video is smaller than player
|
||||||
@ -326,10 +326,10 @@ if(Debug.debug)
|
|||||||
translate.y = hdiff * this.pan.relativeOffsetY / this.zoom.scale;
|
translate.y = hdiff * this.pan.relativeOffsetY / this.zoom.scale;
|
||||||
} else {
|
} else {
|
||||||
if (this.videoFloat == "left") {
|
if (this.videoFloat == "left") {
|
||||||
translate.x = wdiff * 0.5;
|
translate.x = 0;
|
||||||
}
|
}
|
||||||
else if (this.videoFloat == "right") {
|
else if (this.videoFloat == "right") {
|
||||||
translate.x = wdiff * -0.5;
|
translate.x = wdiff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ if(Debug.debug)
|
|||||||
// add remaining elements
|
// add remaining elements
|
||||||
|
|
||||||
if(stretchFactors){
|
if(stretchFactors){
|
||||||
styleArray.push(`transform: scale(${stretchFactors.xFactor}, ${stretchFactors.yFactor}) translate(${translate.x}px, ${translate.y}px)`);
|
styleArray.push(`transform: translate(${translate.x}px, ${translate.y}px) scale(${stretchFactors.xFactor}, ${stretchFactors.yFactor})`);
|
||||||
styleArray.push("top: 0px; left: 0px; bottom: 0px; right: 0px");
|
styleArray.push("top: 0px; left: 0px; bottom: 0px; right: 0px");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
js/uw.js
4
js/uw.js
@ -78,6 +78,10 @@ class UW {
|
|||||||
this.actionHandler = new ActionHandler(this.pageInfo);
|
this.actionHandler = new ActionHandler(this.pageInfo);
|
||||||
this.actionHandler.init();
|
this.actionHandler.init();
|
||||||
|
|
||||||
|
if(Debug.debug) {
|
||||||
|
console.log("[uw.js::setup] ActionHandler initiated:", this.actionHandler);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("[uw::init] FAILED TO START EXTENSION. Error:", e);
|
console.log("[uw::init] FAILED TO START EXTENSION. Error:", e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user