Fix 'fit height' a little
This commit is contained in:
parent
a9f99d93be
commit
609247cbf0
@ -91,10 +91,15 @@ class Scaler {
|
|||||||
const compensatedStreamAr = streamAr * heightCompensationFactor;
|
const compensatedStreamAr = streamAr * heightCompensationFactor;
|
||||||
|
|
||||||
let arCorrectionFactor = 1;
|
let arCorrectionFactor = 1;
|
||||||
if (playerAr < compensatedStreamAr) {
|
|
||||||
arCorrectionFactor = this.conf.player.dimensions.width / this.conf.video.offsetWidth;
|
if (ar.type !== AspectRatio.FitHeight) {
|
||||||
} else if (ar.type !== AspectRatio.Reset) {
|
if (playerAr < compensatedStreamAr) {
|
||||||
arCorrectionFactor /= heightCompensationFactor;
|
console.warn('AR CORRECT FACTOR')
|
||||||
|
arCorrectionFactor = this.conf.player.dimensions.width / this.conf.video.offsetWidth;
|
||||||
|
} else if (ar.type !== AspectRatio.Reset) {
|
||||||
|
console.warn('ANTI-HEIGHTCOMPENSATION')
|
||||||
|
arCorrectionFactor /= heightCompensationFactor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.conf.video){
|
if(!this.conf.video){
|
||||||
|
@ -221,10 +221,10 @@ squeezeFactor: ${squeezeFactor}`, '\nvideo', this.conf.video);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const arCorrectionFactor = this.getArCorrectionFactor();
|
// const arCorrectionFactor = this.getArCorrectionFactor();
|
||||||
// correct factors, unless we're trying to reset
|
// correct factors, unless we're trying to reset
|
||||||
stretchFactors.xFactor *= arCorrectionFactor;
|
// stretchFactors.xFactor *= arCorrectionFactor;
|
||||||
stretchFactors.yFactor *= arCorrectionFactor;
|
// stretchFactors.yFactor *= arCorrectionFactor;
|
||||||
stretchFactors.arCorrectionFactor = this.getArCorrectionFactor();
|
stretchFactors.arCorrectionFactor = this.getArCorrectionFactor();
|
||||||
|
|
||||||
return stretchFactors;
|
return stretchFactors;
|
||||||
|
Loading…
Reference in New Issue
Block a user