Unbreak unofficial themes: laxer widenfactor handling

This commit is contained in:
Pieter Vander Vennet 2021-10-08 12:09:53 +02:00
parent 0d85b5bacf
commit e3e919b16f
2 changed files with 11 additions and 2 deletions

View file

@ -88,7 +88,16 @@ export default class LayoutConfig {
this.startLat = json.startLat;
this.startLon = json.startLon;
if(json.widenFactor < 1){
throw "Widenfactor too small"
if(official){
throw "Widenfactor too small"
}else{
// Unofficial themes get away with this
console.warn("Detected a very small widenfactor, bumping this above 1.")
json.widenFactor = json.widenFactor + 1
}
}
if(json.widenFactor > 20){
throw "Widenfactor is very big, use a value between 1 and 5 (current value is "+json.widenFactor+") at "+context
}
this.widenFactor = json.widenFactor ?? 1.5;
this.roamingRenderings = (json.roamingRenderings ?? []).map((tr, i) => {