Try to fix the broker first screens

This commit is contained in:
WolverinDEV 2019-11-19 18:15:21 +01:00
parent 6a796faffa
commit 2bdb1adf50

View file

@ -17,6 +17,15 @@ if(!$.fn.dividerfy) {
const vertical = element.hasClass("vertical");
const apply_view = (property: "width" | "height", previous: number, next: number) => {
if(previous + next != 100) {
//Fix values if they dont addup to 100
const diff = 100 - (previous + next);
previous += diff * previous / (previous + next);
next += diff * next / (previous + next);
//Some minor adjustments due to roundings
next += 100 - (previous + next);
}
const value_a = "calc(" + previous + "% - " + (vertical ? element.width() : element.height()) + "px)";
const value_b = "calc(" + next + "% - " + (vertical ? element.width() : element.height()) + "px)";